public ActionResult Index(int job_id)
        {
            Jobs       js        = new Jobs();
            Timer_Jobs tj        = js.GetTimerJob(job_id);
            string     qeendtime = tj.STR_RES_3;

            if (DateTime.Now < DateTime.Parse(qeendtime))
            {
                ViewBag.zgenable = 1;
            }
            else
            {
                ViewBag.zgenable = 0;
            }
            ViewBag.jobName = tj.job_name;
            ViewBag.time    = tj.STR_RES_2;
            ViewBag.depts   = tj.STR_RES_1;
            ViewBag.wfe_ids = tj.run_result;

            int             UserId = (Session["User"] as EquipModel.Entities.Person_Info).Person_Id;
            PersonManagment pm     = new PersonManagment();

            EquipBLL.AdminManagment.PersonManagment.P_viewModal pv = pm.Get_PersonModal(UserId);
            if (pv.Role_Names.Contains("可靠性工程师"))
            {
                ViewBag.isKkxgcs = "1";
            }
            else
            {
                ViewBag.isKkxgcs = "0";
            }
            return(View());
        }
        public ActionResult UpdateUser(int userId)
        {
            PersonManagment PM = new PersonManagment();

            EquipBLL.AdminManagment.PersonManagment.P_viewModal pm_info = PM.Get_PersonModal(userId);
            return(View(pm_info));
        }
        public string testgetA14dot3dot4dcl_list(string WorkFlow_Name)
        {
            List <A14dot3dot4Model> Am = new List <A14dot3dot4Model>();

            A14dot3dot4Model o = new A14dot3dot4Model();

            o.index_Id      = 1;
            o.zz_name       = "1#常压装置";
            o.sb_gycode     = "1#常压常一中泵P112A";
            o.sb_code       = "210000034";
            o.sb_type       = "150HDS-91";
            o.sb_ABCMark    = "C";
            o.plan_name     = "来自DRBPM";
            o.jxreason      = "就是想检修";
            o.xcconfirm     = "同意";
            o.kkconfirm2    = "同意";
            o.zytdconfirm2  = "同意";
            o.job_order2    = "23333";
            o.notice_order2 = "";    //通过工单号获取通知单号 Q1:会有无法获取通知单号的情况吗,是否允许手动填写
            o.missionname   = "";
            int             UserId = (Session["User"] as EquipModel.Entities.Person_Info).Person_Id;
            PersonManagment pm     = new PersonManagment();

            EquipBLL.AdminManagment.PersonManagment.P_viewModal pv = pm.Get_PersonModal(UserId);
            o.role = pv.Role_Names;

            Am.Add(o);

            string str = JsonConvert.SerializeObject(Am);

            return("{" + "\"data\": " + str + "}");
        }
Exemple #4
0
        // GET: /A7dot1/美迅平台数据筛选
        public ActionResult MxptSelect(string flowname)
        {
            //页面权限,现场工程师能处理
            int             cur_PersionID = (Session["User"] as EquipModel.Entities.Person_Info).Person_Id;
            PersonManagment pm            = new PersonManagment();

            EquipBLL.AdminManagment.PersonManagment.P_viewModal pv = pm.Get_PersonModal(cur_PersionID);
            ViewBag.user_Role = pv.Role_Names;
            return(View(getA7dot1MxAlarm_Model())); //2016.6.22
        }
        public ActionResult GraphicData(string wfe_id)
        {
            int             cur_PersionID = (Session["User"] as EquipModel.Entities.Person_Info).Person_Id;
            PersonManagment pm            = new PersonManagment();

            EquipBLL.AdminManagment.PersonManagment.P_viewModal pv = pm.Get_PersonModal(cur_PersionID);
            ViewBag.user_specis = pv.Speciaty_Names;
            UI_MISSION miss = CWFEngine.GetActiveMission <Person_Info>(int.Parse(wfe_id), ((IObjectContextAdapter)(new EquipWebContext())).ObjectContext, false);

            ViewBag.currentMiss = miss;
            return(View(getWFDetail_Model(wfe_id)));
        }
Exemple #6
0
        // GET: /A7dot2/DRBMP平台数据筛选
        public ActionResult DrbpmSelect(string flowname)
        {
            //return View(getA7dot2_Model()); //2016.7.25
            string strTableName = "SbGyAnalysis";
            string strWhere     = "1=1";//
            //页面权限,现场工程师能处理
            int             cur_PersionID = (Session["User"] as EquipModel.Entities.Person_Info).Person_Id;
            PersonManagment pm            = new PersonManagment();

            EquipBLL.AdminManagment.PersonManagment.P_viewModal pv = pm.Get_PersonModal(cur_PersionID);
            ViewBag.user_Role = pv.Role_Names;
            return(View(getDRBPM_SbGyAnalysisList(strTableName, strWhere)));//2016.7.25
        }
 public ActionResult Submit()
 {
     submitmodel sm = new submitmodel();
     ViewBag.curtime = DateTime.Now;
     ViewBag.curuser = (Session["User"] as EquipModel.Entities.Person_Info).Person_Name;
     int UserId = (Session["User"] as EquipModel.Entities.Person_Info).Person_Id;
     PersonManagment pm = new PersonManagment();
     EquipBLL.AdminManagment.PersonManagment.P_viewModal pv = pm.Get_PersonModal(UserId);
     if (pv.Role_Names.Contains("可靠性工程师"))
         sm.kkxgcs = 1;
     if (pv.Role_Names.Contains("检维修人员"))
         sm.jwxry = 1;
     return View(sm);
 }
        // GET: JobsManagement
        public ActionResult Index()
        {
            int             UserId = (Session["User"] as EquipModel.Entities.Person_Info).Person_Id;
            PersonManagment pm     = new PersonManagment();

            EquipBLL.AdminManagment.PersonManagment.P_viewModal pv = pm.Get_PersonModal(UserId);

            if (pv.Role_Names.Contains("专业团队") || pv.Role_Names.Contains("专家团队") || pv.Role_Names.Contains("专业团队负责人"))
            {
                ViewBag.zytd = 1;
            }
            else
            {
                ViewBag.zytd = 0;
            }
            return(View());
        }
        public string getA14dot3dot4dcl_list(string WorkFlow_Name)
        {
            List <A14dot3dot4Model> Am = new List <A14dot3dot4Model>();

            List <A14dot3dot4_ModelInfo> YueduDRBPM = new List <A14dot3dot4_ModelInfo>();

            YueduDRBPM = getA14dot3dot4_Model().A14dot3dot4_ModelInfoList;

            for (int j = 0; j < YueduDRBPM.Count; j++)
            {
                A14dot3dot4Model o = new A14dot3dot4Model();
                o.index_Id      = j + 1;
                o.zz_name       = YueduDRBPM[j].Zz_Name;
                o.sb_gycode     = YueduDRBPM[j].Equip_GyCode;
                o.sb_code       = YueduDRBPM[j].Equip_Code;
                o.sb_type       = YueduDRBPM[j].Equip_Type;
                o.sb_ABCMark    = YueduDRBPM[j].Equip_ABCMark;
                o.plan_name     = "来自DRBPM";
                o.jxreason      = YueduDRBPM[j].Jx_Reason;
                o.xcconfirm     = "同意";
                o.kkconfirm2    = "同意";
                o.zytdconfirm2  = "同意";
                o.job_order2    = YueduDRBPM[j].Job_Order;
                o.notice_order2 = "";//通过工单号获取通知单号 Q1:会有无法获取通知单号的情况吗,是否允许手动填写

                if (!string.IsNullOrEmpty(YueduDRBPM[j].JxSubmit_done.Trim()))
                {
                    o.missionname = "已跳转至A8.2";
                }
                else
                {
                    o.missionname = "审核已完成,工单待填写";
                }
                int             UserId = (Session["User"] as EquipModel.Entities.Person_Info).Person_Id;
                PersonManagment pm     = new PersonManagment();
                EquipBLL.AdminManagment.PersonManagment.P_viewModal pv = pm.Get_PersonModal(UserId);
                o.role = pv.Role_Names;

                Am.Add(o);
            }
            string str = JsonConvert.SerializeObject(Am);

            return("{" + "\"data\": " + str + "}");
        }
Exemple #10
0
        public ActionResult CaiGouConfirm(string wfe_id)
        {
            Dictionary <string, object> paras1 = new Dictionary <string, object>();

            paras1["Job_OrderState"] = null;

            UI_WFEntity_Info wfei = CWFEngine.GetWorkFlowEntityWithParams(Convert.ToInt32(wfe_id), paras1);

            ViewBag.Job_OrderState = paras1["Job_OrderState"].ToString();
            int             cur_PersionID = (Session["User"] as EquipModel.Entities.Person_Info).Person_Id;
            PersonManagment pm            = new PersonManagment();

            EquipBLL.AdminManagment.PersonManagment.P_viewModal pv = pm.Get_PersonModal(cur_PersionID);
            ViewBag.user_Role   = pv.Role_Names;
            ViewBag.user_Depart = pv.Department_Name;
            UI_MISSION miss = CWFEngine.GetActiveMission <Person_Info>(int.Parse(wfe_id), ((IObjectContextAdapter)(new EquipWebContext())).ObjectContext);

            ViewBag.currentMiss = miss;
            return(View(getWFDetail_Model(wfe_id)));
        }
        // GET: /A7dot1dot1/检修单位确认
        public ActionResult JxdwConfirm(string wfe_id)
        {
            int             cur_PersionID = (Session["User"] as EquipModel.Entities.Person_Info).Person_Id;
            PersonManagment pm            = new PersonManagment();

            EquipBLL.AdminManagment.PersonManagment.P_viewModal pv = pm.Get_PersonModal(cur_PersionID);
            ViewBag.user_specis = pv.Speciaty_Names;
            UI_MISSION miss = CWFEngine.GetActiveMission <Person_Info>(int.Parse(wfe_id), ((IObjectContextAdapter)(new EquipWebContext())).ObjectContext);

            ViewBag.currentMiss = miss;
            //由于DongZyConfirm_done 等变量未与该Event关联,所以无法获取, 故而我在下面模拟了这几个变量
            //同样的问题也会出现在JxdwConfirm_submitsignal函数中
            //WFDetail_Model dfm = getWFDetail_Model(wfe_id);
            //dfm.ALLHistoryMiss.Last().Miss_Params["DongZyConfirm_done"] = true.ToString();
            //dfm.ALLHistoryMiss.Last().Miss_Params["DongZyMan"] = "fhp";
            //dfm.ALLHistoryMiss.Last().Miss_Params["DianZyConfirm_done"] = false.ToString();
            //dfm.ALLHistoryMiss.Last().Miss_Params["DianZyMan"] = "";
            //dfm.ALLHistoryMiss.Last().Miss_Params["YiZyConfirm_done"] = false.ToString();
            //dfm.ALLHistoryMiss.Last().Miss_Params["YiZyMan"] = "";
            return(View(getWFDetail_Model(wfe_id)));
            //return View(dfm);
        }
Exemple #12
0
        public ActionResult Index0()
        {
            if (Session["User"] == null)
            {
                Response.Redirect("/Login/chaoshi");
                return(View());
            }
            else
            {
                getIndexmodel model = new getIndexmodel();

                model.mt       = menuconfig.BuildMenuList();
                model.username = (Session["User"] as EquipModel.Entities.Person_Info).Person_Name;
                model.userid   = (Session["User"] as EquipModel.Entities.Person_Info).Person_Id;
                PersonManagment PM = new PersonManagment();
                EquipBLL.AdminManagment.PersonManagment.P_viewModal pm_info = PM.Get_PersonModal(model.userid);
                model.belong_depart = pm_info.Department_Name;

                model.isManager = PM.is_Role_admin(model.username);

                //int a = mt.Count();
                return(View(model));
            }
        }
        private DtResponse ProcessRequest(List <KeyValuePair <string, string> > data)
        {
            DtResponse dt     = new DtResponse();
            var        http   = DtRequest.HttpData(data);
            var        Data   = http["data"] as Dictionary <string, object>;
            int        wfe_id = -1;

            foreach (var d in Data)
            {
                wfe_id = Convert.ToInt32(d.Key);
            }
            string jx_reason    = "";
            string E_code       = "";
            string job_order    = "";
            string notice_order = "";

            foreach (var d in Data)
            {
                int id = Convert.ToInt32(d.Key);
                foreach (var dd in d.Value as Dictionary <string, object> )
                {
                    ERPInfoManagement erp = new ERPInfoManagement();

                    //sb_code、jxreason与设备绑定在一起传过来,当通知单号工单号填完后满足向A8.2跳转条件
                    if (dd.Key == "sb_code")
                    {
                        E_code = dd.Value.ToString();
                    }
                    if (dd.Key == "jxreason")
                    {
                        jx_reason = dd.Value.ToString();
                    }
                    if (dd.Key == "notice_order2")
                    {
                        if (dd.Value.ToString() == "")
                        {
                            continue;
                        }
                        notice_order = "00" + dd.Value.ToString();
                        GD_InfoModal res = erp.getGD_Modal_Notice(notice_order);
                        if (res != null)
                        {
                            job_order = res.GD_Id;
                        }
                    }
                    if (dd.Key == "job_order2")
                    {
                        if (dd.Value.ToString() == "")
                        {
                            continue;
                        }
                        job_order = "00" + dd.Value.ToString();
                        GD_InfoModal res = erp.getGD_Modal_GDId(job_order);
                        if (res != null)
                        {
                            notice_order = res.GD_Notice_Id;
                        }
                    }
                    //if (dd.Key == "JumpA8dot2DR")
                    //{
                    //    string Equip_Code = E_code;
                    //    string Jx_Reason = jx_reason;
                    //    string flowname = "A8dot2";
                    //    UI_WorkFlow_Entity wfe = CWFEngine.CreateAWFEntityByName(flowname);
                    //    if (wfe != null)
                    //    {
                    //        EquipManagment em = new EquipManagment();
                    //        Equip_Info eqinfo = em.getEquip_Info(Equip_Code);
                    //        List<Equip_Archi> Equip_ZzBelong = em.getEquip_ZzBelong(eqinfo.Equip_Id);
                    //        Dictionary<string, string> record = wfe.GetRecordItems();
                    //        record["username"] = (Session["User"] as EquipModel.Entities.Person_Info).Person_Name;
                    //        record["time"] = DateTime.Now.ToString();
                    //        wfe.Start(record);
                    //        int flow_id = wfe.EntityID;
                    //        //paras
                    //        Dictionary<string, string> signal = new Dictionary<string, string>();
                    //        signal["JxSubmit_done"] = "true";
                    //        signal["Cj_Name"] = Equip_ZzBelong[1].EA_Name; //Cj_Name
                    //        signal["Zz_Name"] = Equip_ZzBelong[0].EA_Name; //Zz_Name
                    //        signal["Equip_GyCode"] = eqinfo.Equip_GyCode;
                    //        signal["Equip_Code"] = eqinfo.Equip_Code;
                    //        signal["Equip_Type"] = eqinfo.Equip_Type;
                    //        signal["Zy_Type"] = eqinfo.Equip_Specialty;
                    //        signal["Zy_SubType"] = eqinfo.Equip_PhaseB;
                    //        signal["Equip_ABCMark"] = eqinfo.Equip_ABCmark;
                    //        signal["Jx_Reason"] = Jx_Reason;//计划检修原因 PM?
                    //        signal["Job_Name"] = "来自DRBPM";
                    //        signal["Job_Order"] = job_order;
                    //        //record
                    //        record["username"] = (Session["User"] as EquipModel.Entities.Person_Info).Person_Name;
                    //        record["time"] = DateTime.Now.ToString();
                    //        //submit
                    //        CWFEngine.SubmitSignal(flow_id, signal, record);

                    //    }
                    //}
                }
            }


            Dictionary <string, object> m_kv   = new Dictionary <string, object>();
            EquipManagment     em1             = new EquipManagment();
            Equip_Info         eqinfo1         = em1.getEquip_Info(E_code);
            List <Equip_Archi> Equip_ZzBelong1 = em1.getEquip_ZzBelong(eqinfo1.Equip_Id);


            int             UserId = (Session["User"] as EquipModel.Entities.Person_Info).Person_Id;
            PersonManagment pm     = new PersonManagment();

            EquipBLL.AdminManagment.PersonManagment.P_viewModal pv = pm.Get_PersonModal(UserId);

            m_kv["index_Id"]      = wfe_id;
            m_kv["zz_name"]       = Equip_ZzBelong1[0].EA_Name; //Zz_Name
            m_kv["sb_gycode"]     = eqinfo1.Equip_GyCode;
            m_kv["sb_code"]       = E_code;
            m_kv["sb_type"]       = eqinfo1.Equip_Type;
            m_kv["sb_ABCMark"]    = eqinfo1.Equip_ABCmark;
            m_kv["plan_name"]     = "来自DRBPM";
            m_kv["jxreason"]      = jx_reason;
            m_kv["kkconfirm2"]    = "同意";
            m_kv["zytdconfirm2"]  = "同意";
            m_kv["job_order2"]    = job_order;
            m_kv["notice_order2"] = notice_order;
            m_kv["missionname"]   = "完善工单与通知单后跳转";
            m_kv["role"]          = pv.Role_Names;
            dt.data.Add(m_kv);


            return(dt);
        }
Exemple #14
0
        //获取临时待处理任务
        public string getJobList()
        {
            Jobs            m      = new Jobs();
            int             UserId = (Session["User"] as EquipModel.Entities.Person_Info).Person_Id;
            PersonManagment pm     = new PersonManagment();

            EquipBLL.AdminManagment.PersonManagment.P_viewModal pv = pm.Get_PersonModal(UserId);
            int zytd;

            if (pv.Role_Names.Contains("专业团队") || pv.Role_Names.Contains("专家团队") || pv.Role_Names.Contains("专业团队负责人"))
            {
                zytd = 1;
            }
            else
            {
                zytd = 0;
            }
            List <Timer_Jobs> Joblist = m.GetAllTimerJob();

            List <object> r = new List <object>();

            for (int i = 0; i < Joblist.Count; i++)
            {
                if (Joblist[i].custom_flag == 1 && Joblist[i].Job_Type == TIMER_JOB_TYPE.CREATE_WORKFLOW)
                {
                    List <string> cjnames  = new List <string>();
                    string        Cj_Names = "";
                    JArray        jsonVal  = JArray.Parse(Joblist[i].run_params) as JArray;
                    dynamic       table2   = jsonVal;
                    foreach (dynamic T in table2)
                    {
                        WorkFlow_Define wfd = wfs.GetWorkFlowDefineByID(Joblist[i].workflow_ID);
                        if (wfd.W_Name == "A6dot2dot2")
                        {
                            // JObject item = (JObject)JsonConvert.DeserializeObject(T.PARAMS);

                            string cjid    = T.PARAMS.Cj_Name.ToString();
                            string cj_name = Em.getEa_namebyId(Convert.ToInt16(cjid));
                            cjnames.Add(cj_name);
                        }
                        else
                        {
                            foreach (dynamic t in T.PARAMS)
                            {
                                string cjtemp = "";
                                cjtemp = t.Value;



                                cjnames.Add(cjtemp);
                            }
                        }
                    }
                    for (int k = 0; k < cjnames.Count; k++)
                    {
                        EquipArchiManagment em = new EquipArchiManagment();
                        // Cj_Names = Cj_Names + em.getEa_namebyId(Convert.ToInt16(cjnames[k])) + "、";
                        Cj_Names = Cj_Names + cjnames[k] + "、";
                    }
                    //string job_time = "";
                    //string[] job_timelist = Joblist[i].corn_express.Split(new char[] { ' ' });
                    //job_time = job_timelist[6] + "年" + job_timelist[4] + "月" + job_timelist[3] + "日";
                    string wf_name  = wfs.GetWorkFlowDefineByID(Joblist[i].workflow_ID).W_Name + ":" + wfs.GetWorkFlowDefineByID(Joblist[i].workflow_ID).W_Attribution;
                    string job_desc = wfs.GetWorkFlowDefineByID(Joblist[i].workflow_ID).W_Name;


                    object o = new
                    {
                        job_id     = Joblist[i].JOB_ID,
                        index      = i + 1,
                        jobName    = Joblist[i].job_name,
                        jobType    = wf_name,
                        job_desc   = job_desc,
                        jobTIme    = Joblist[i].STR_RES_2,
                        jobRunPara = Cj_Names,
                        jobStatus  = Joblist[i].status,
                        job_dep    = Joblist[i].STR_RES_1,
                        job_result = Joblist[i].run_result,
                        iszytd     = zytd
                    };
                    r.Add(o);
                }
            }
            string str = JsonConvert.SerializeObject(r);

            return("{" + "\"data\": " + str + "}");
        }
Exemple #15
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));
        }
Exemple #16
0
        //zxh

        public string ListMission_zxh()
        {
            try
            {
                IObjectContextAdapter IOca = new EquipWebContext();

                List <UI_MISSION> miss = CWFEngine.GetActiveMissions <Person_Info>(IOca.ObjectContext);


                List <Object> miss_obj = new List <object>();
                string        userName = (Session["User"] as EquipModel.Entities.Person_Info).Person_Name.ToString();
                foreach (UI_MISSION item in miss)
                {
                    MainMissionsModel mm = GetMainMissionsInfo(item.WE_Entity_Id);


                    Jobs   js      = new Jobs();
                    string endtime = "";
                    string lsh_xy  = "1";


                    if (js.GetDSnexttime(mm.jobname, item.WE_Entity_Id) != null)
                    {
                        if (js.GetDSnexttime(mm.jobname, item.WE_Entity_Id).PreTime == null)
                        {
                            string        end_corn = js.GetDSnexttime(mm.jobname, item.WE_Entity_Id).corn_express;
                            TriggerTiming TT       = new TriggerTiming();
                            TT.FromString(end_corn);
                            TT.RefreshNextTiming(DateTime.Now);
                            endtime = TT.NextTiming.ToString();
                        }
                        else
                        {
                            endtime = js.GetDSnexttime(mm.jobname, item.WE_Entity_Id).PreTime.ToString();
                        }
                    }


                    if (mm.Equip_GyCode == null || mm.Equip_GyCode == "")
                    {
                        lsh_xy = "0";
                    }
                    object o = new
                    {
                        WF_ICON    = "fa fa-flash text-text-aqua",
                        MISS_Url   = item.Mission_Url,
                        WF_Name    = mm.WF_Name,
                        MISS_Name  = item.WE_Event_Desc,
                        wfe_serial = mm.wfe_serial,
                        sbCode     = mm.Equip_GyCode,
                        time       = mm.time,
                        endtime    = endtime,
                        lsh_xy     = lsh_xy
                    };
                    EquipManagment em = new EquipManagment();
                    if (mm.WF_Name.Contains("定时KPI月报"))
                    {
                        if (userName == "龚海桥" && mm.WF_Name.Contains("联合一片区"))
                        {
                            miss_obj.Add(o);
                        }
                        else if (userName == "丁一刚" && mm.WF_Name.Contains("联合二片区"))
                        {
                            miss_obj.Add(o);
                        }
                        else if (userName == "邓杰" && (mm.WF_Name.Contains("联合三片区") || mm.WF_Name.Contains("化工片区")))
                        {
                            miss_obj.Add(o);
                        }
                        else if (userName == "杨书毅" && mm.WF_Name.Contains("联合四片区"))
                        {
                            miss_obj.Add(o);
                        }
                        else if (userName == "武文斌" && (mm.WF_Name.Contains("综合片区") || mm.WF_Name.Contains("系统片区")))
                        {
                            miss_obj.Add(o);
                        }
                    }
                    else
                    {
                        if (userName == "sa" || userName == "程聂")
                        {
                            miss_obj.Add(o);
                        }
                        else
                        {
                            if (lsh_xy == "1")
                            {
                                if (em.getEquip_ByGyCode(mm.Equip_GyCode).Equip_Specialty == "动")
                                {
                                    miss_obj.Add(o);
                                }
                            }
                            else
                            {
                                miss_obj.Add(o);
                            }
                        }
                    }
                }

                TablesManagment tm     = new TablesManagment();
                int             UserId = (Session["User"] as EquipModel.Entities.Person_Info).Person_Id;
                PersonManagment pm     = new PersonManagment();
                EquipBLL.AdminManagment.PersonManagment.P_viewModal pv = pm.Get_PersonModal(UserId);
                if (pv.Role_Names.Contains("可靠性工程师"))
                {
                    string             wfe_ser = "";
                    List <string>      cjname  = new List <string>();
                    List <Equip_Archi> EA      = pm.Get_Person_Cj(UserId);
                    foreach (var ea in EA)
                    {
                        cjname.Add(ea.EA_Name);
                    }
                    List <A5dot1Tab1> E = tm.Getdcl_listbyisZG(0, cjname);

                    for (int i = 0; i < E.Count; i++)
                    {
                        if (E[i].dataSource != null)
                        {
                            wfe_ser = E[i].dataSource;
                        }
                        object o = new
                        {
                            WF_ICON    = "fa fa-flash text-text-aqua",
                            MISS_Url   = "/A5dot1/Index",
                            WF_Name    = "设备完好",
                            MISS_Name  = "可靠性工程师确认整改",
                            wfe_serial = wfe_ser,
                            sbCode     = E[i].sbGyCode.ToString(),
                            time       = E[i].zzSubmitTime.ToString(),
                            endtime    = "",
                            lsh_xy     = 1
                        };
                        miss_obj.Add(o);
                    }
                    SxglManagment     Sx = new SxglManagment();
                    List <A5dot2Tab1> EE = Sx.GetSxItem(cjname);
                    foreach (var item in EE)
                    {
                        if (item.temp2 != null)
                        {
                            wfe_ser = item.temp2;
                        }
                        object o = new
                        {
                            WF_ICON    = "fa fa-flash text-text-aqua",
                            MISS_Url   = "/A5dot2/Index",
                            WF_Name    = "竖向问题",
                            MISS_Name  = "可靠性工程师确认整改",
                            wfe_serial = wfe_ser,
                            sbCode     = item.sbGyCode.ToString(),
                            time       = item.jxSubmitTime.ToString(),
                            endtime    = "",
                            lsh_xy     = 1
                        };
                        miss_obj.Add(o);
                    }
                }

                string str = JsonConvert.SerializeObject(miss_obj);
                return("{" + "\"data\": " + str + "}");
            }
            catch (Exception e)
            {
                return(null);
            }
        }
Exemple #17
0
 public Index_ModelforA15 getRecord_detail(string id)
 {
     Index_ModelforA15 RecordforA15 = new Index_ModelforA15();
     RecordforA15.Am = new List<A15dot1Tab>();
     RecordforA15.Hm = new List<A15dot1Tab>();
     ViewBag.curtime = DateTime.Now.ToString();
     ViewBag.curuser = (Session["User"] as EquipModel.Entities.Person_Info).Person_Name;
     int IntId = Convert.ToInt32(id);
     List<A15dot1Tab> miss = Jx.GetJxItem_detail(IntId);
     foreach (var item in miss)
     {
         A15dot1Tab a = new A15dot1Tab();
         a.timesNonPlanStop = item.timesNonPlanStop;
         a.scoreDeductFaultIntensity = item.scoreDeductFaultIntensity;
         a.rateBigUnitFault = item.rateBigUnitFault;
         a.rateFaultMaintenance = item.rateFaultMaintenance;
         a.MTBF = item.MTBF;
         a.rateEquipUse = item.rateEquipUse;
         a.rateUrgentRepairWorkHour = item.rateUrgentRepairWorkHour;
         a.hourWorkOrderFinish = item.hourWorkOrderFinish;
         a.avgLifeSpanSeal = item.avgLifeSpanSeal;
         a.avgLifeSpanAxle = item.avgLifeSpanAxle;
         a.percentEquipAvailability = item.percentEquipAvailability;
         a.percentPassOnetimeRepair = item.percentPassOnetimeRepair;
         a.avgEfficiencyPump = item.avgEfficiencyPump;
         a.avgEfficiencyUnit = item.avgEfficiencyUnit;
         a.hiddenDangerInvestigation = item.hiddenDangerInvestigation;
         a.rateLoad = item.rateLoad;
         a.gyChange = item.gyChange;
         a.equipChange = item.equipChange;
         a.otherDescription = item.otherDescription;
         a.evaluateEquipRunStaeDesc = item.evaluateEquipRunStaeDesc;
         a.evaluateEquipRunStaeImgPath = item.evaluateEquipRunStaeImgPath;
         a.reliabilityConclusion = item.reliabilityConclusion;
         a.jdcAdviseImproveMeasures = item.jdcAdviseImproveMeasures;
         a.submitDepartment = item.submitDepartment;
         a.submitUser = item.submitUser;
         a.submitTime = item.submitTime;
         a.jdcOperator = item.jdcOperator;
         a.jdcOperateTime = item.jdcOperateTime;
         a.reportType = item.reportType;
         a.temp1 = Convert.ToString(miss.IndexOf(item) + 1);
         a.submitUser = item.submitUser;
         a.submitTime = item.submitTime;
         a.state = item.state;
         a.Id = item.Id;
         //增加变量--参与统计台数
         a.Count_timesNonPlanStop = item.Count_timesNonPlanStop;
         a.Count_scoreDeductFaultIntensity = item.Count_scoreDeductFaultIntensity;
         a.Count_rateBigUnitFault = item.Count_rateBigUnitFault;
         a.Count_rateFaultMaintenance = item.Count_rateFaultMaintenance;
         a.Count_MTBF = item.Count_MTBF;
         a.Count_rateEquipUse = item.Count_rateEquipUse;
         a.Count_avgLifeSpanSeal = item.Count_avgLifeSpanSeal;
         a.Count_avgLifeSpanAxle = item.Count_avgLifeSpanAxle;
         a.Count_percentEquipAvailability = item.Count_percentEquipAvailability;
         a.Count_percentPassOnetimeRepair = item.Count_percentPassOnetimeRepair;
         RecordforA15.Am.Add(a);
     }
     string name = RecordforA15.Am[0].submitUser;
     PersonManagment pm = new PersonManagment();
     int UserId = pm.Get_Person(name).Person_Id;
     EquipBLL.AdminManagment.PersonManagment.P_viewModal pv = pm.Get_PersonModal(UserId);
     if (pv.Role_Names.Contains("可靠性工程师"))
         RecordforA15.am = 1;
     else
         RecordforA15.am = 0;
     List<A15dot1Tab> His = Jx.GetHisJxItem_detail(IntId);
     foreach (var item in His)
     {
         A15dot1Tab a = new A15dot1Tab();
         a.timesNonPlanStop = item.timesNonPlanStop;
         a.scoreDeductFaultIntensity = item.scoreDeductFaultIntensity;
         a.rateBigUnitFault = item.rateBigUnitFault;
         a.rateFaultMaintenance = item.rateFaultMaintenance;
         a.MTBF = item.MTBF;
         a.rateEquipUse = item.rateEquipUse;
         a.rateUrgentRepairWorkHour = item.rateUrgentRepairWorkHour;
         a.hourWorkOrderFinish = item.hourWorkOrderFinish;
         a.avgLifeSpanSeal = item.avgLifeSpanSeal;
         a.avgLifeSpanAxle = item.avgLifeSpanAxle;
         a.percentEquipAvailability = item.percentEquipAvailability;
         a.percentPassOnetimeRepair = item.percentPassOnetimeRepair;
         a.avgEfficiencyPump = item.avgEfficiencyPump;
         a.avgEfficiencyUnit = item.avgEfficiencyUnit;
         a.hiddenDangerInvestigation = item.hiddenDangerInvestigation;
         a.rateLoad = item.rateLoad;
         a.gyChange = item.gyChange;
         a.equipChange = item.equipChange;
         a.otherDescription = item.otherDescription;
         a.evaluateEquipRunStaeDesc = item.evaluateEquipRunStaeDesc;
         a.evaluateEquipRunStaeImgPath = item.evaluateEquipRunStaeImgPath;
         a.reliabilityConclusion = item.reliabilityConclusion;
         a.jdcAdviseImproveMeasures = item.jdcAdviseImproveMeasures;
         a.submitDepartment = item.submitDepartment;
         a.submitUser = item.submitUser;
         a.submitTime = item.submitTime;
         a.jdcOperator = item.jdcOperator;
         a.jdcOperateTime = item.jdcOperateTime;
         a.reportType = item.reportType;
         a.temp1 = Convert.ToString(miss.IndexOf(item) + 1);
         a.submitUser = item.submitUser;
         a.submitTime = item.submitTime;
         a.state = item.state;
         a.Id = item.Id;
         //增加变量--参与统计台数
         a.Count_timesNonPlanStop = item.Count_timesNonPlanStop;
         a.Count_scoreDeductFaultIntensity = item.Count_scoreDeductFaultIntensity;
         a.Count_rateBigUnitFault = item.Count_rateBigUnitFault;
         a.Count_rateFaultMaintenance = item.Count_rateFaultMaintenance;
         a.Count_MTBF = item.Count_MTBF;
         a.Count_rateEquipUse = item.Count_rateEquipUse;
         a.Count_avgLifeSpanSeal = item.Count_avgLifeSpanSeal;
         a.Count_avgLifeSpanAxle = item.Count_avgLifeSpanAxle;
         a.Count_percentEquipAvailability = item.Count_percentEquipAvailability;
         a.Count_percentPassOnetimeRepair = item.Count_percentPassOnetimeRepair;
         RecordforA15.Hm.Add(a);
     }
     name = RecordforA15.Hm[0].submitUser;
     UserId = pm.Get_Person(name).Person_Id;
     pv = pm.Get_PersonModal(UserId);
     if (pv.Role_Names.Contains("可靠性工程师"))
         RecordforA15.hm = 1;
     else
         RecordforA15.hm = 0;
     return RecordforA15;
 }
        public Index_ModelforA15 getRecord_detail(string id)
        {
            Index_ModelforA15 RecordforA15 = new Index_ModelforA15();

            RecordforA15.Am = new List <A15dot1TabQiYe>();
            RecordforA15.Hm = new List <A15dot1TabQiYe>();
            ViewBag.curtime = DateTime.Now.ToString();
            ViewBag.curuser = (Session["User"] as EquipModel.Entities.Person_Info).Person_Name;
            int IntId = Convert.ToInt32(id);
            List <A15dot1TabQiYe> miss = Jx.GetJxItem_detail(IntId);

            foreach (var item in miss)
            {
                A15dot1TabQiYe a = new A15dot1TabQiYe();
                a.zzkkxzs               = item.zzkkxzs;
                a.wxfyzs                = item.wxfyzs;
                a.qtlxbmfxhl            = item.qtlxbmfxhl;
                a.qtlhsbgsghl           = item.qtlhsbgsghl;
                a.ybsjkzl               = item.ybsjkzl;
                a.sjs                   = item.sjs;
                a.gzqdkf                = item.gzqdkf;
                a.xmyql                 = item.xmyql;
                a.pxjnl                 = item.pxjnl;
                a.submitDepartment      = item.submitDepartment;
                a.submitUser            = item.submitUser;
                a.submitTime            = item.submitTime;
                a.jdcOperator           = item.jdcOperator;
                a.jdcOperateTime        = item.jdcOperateTime;
                a.reportType            = item.reportType;
                a.temp1                 = Convert.ToString(miss.IndexOf(item) + 1);
                a.submitUser            = item.submitUser;
                a.submitTime            = item.submitTime;
                a.state                 = item.state;
                a.temp3                 = item.temp3;
                a.reliabilityConclusion = item.reliabilityConclusion;
                a.Id = item.Id;
                RecordforA15.Am.Add(a);
            }
            string          name   = RecordforA15.Am[0].submitUser;
            PersonManagment pm     = new PersonManagment();
            int             UserId = pm.Get_Person(name).Person_Id;

            EquipBLL.AdminManagment.PersonManagment.P_viewModal pv = pm.Get_PersonModal(UserId);
            if (pv.Role_Names.Contains("可靠性工程师"))
            {
                RecordforA15.am = 1;
            }
            else
            {
                RecordforA15.am = 0;
            }
            List <A15dot1TabQiYe> His = Jx.GetHisJxItem_detail(IntId);

            foreach (var item in His)
            {
                A15dot1TabQiYe a = new A15dot1TabQiYe();
                a.zzkkxzs          = item.zzkkxzs;
                a.wxfyzs           = item.wxfyzs;
                a.qtlxbmfxhl       = item.qtlxbmfxhl;
                a.qtlhsbgsghl      = item.qtlhsbgsghl;
                a.ybsjkzl          = item.ybsjkzl;
                a.sjs              = item.sjs;
                a.gzqdkf           = item.gzqdkf;
                a.xmyql            = item.xmyql;
                a.pxjnl            = item.pxjnl;
                a.submitDepartment = item.submitDepartment;
                a.submitUser       = item.submitUser;
                a.submitTime       = item.submitTime;
                a.jdcOperator      = item.jdcOperator;
                a.jdcOperateTime   = item.jdcOperateTime;
                a.reportType       = item.reportType;
                a.temp1            = Convert.ToString(miss.IndexOf(item) + 1);
                a.submitUser       = item.submitUser;
                a.submitTime       = item.submitTime;
                a.state            = item.state;
                a.Id = item.Id;
                RecordforA15.Hm.Add(a);
            }
            name   = RecordforA15.Hm[0].submitUser;
            UserId = pm.Get_Person(name).Person_Id;
            pv     = pm.Get_PersonModal(UserId);
            if (pv.Role_Names.Contains("可靠性工程师"))
            {
                RecordforA15.hm = 1;
            }
            else
            {
                RecordforA15.hm = 0;
            }
            return(RecordforA15);
        }
Exemple #19
0
        private DtResponse ProcessRequest(List <KeyValuePair <string, string> > data)
        {
            DtResponse dt     = new DtResponse();
            var        http   = DtRequest.HttpData(data);
            var        Data   = http["data"] as Dictionary <string, object>;
            int        wfe_id = -1;

            foreach (var d in Data)
            {
                wfe_id = Convert.ToInt32(d.Key);
            }
            foreach (var d in Data)
            {
                int id = Convert.ToInt32(d.Key);
                foreach (var dd in d.Value as Dictionary <string, object> )
                {
                    ERPInfoManagement           erp    = new ERPInfoManagement();
                    Dictionary <string, string> signal = new Dictionary <string, string>();
                    if (dd.Key == "plan_name")
                    {
                        signal["Plan_Name"] = dd.Value.ToString();

                        //record
                        Dictionary <string, string> record1 = new Dictionary <string, string>();
                        record1["username"] = (Session["User"] as EquipModel.Entities.Person_Info).Person_Name;
                        record1["time"]     = DateTime.Now.ToString();
                        //submit
                        CWFEngine.SubmitSignal(Convert.ToInt32(id), signal, record1);
                    }
                    if (dd.Key == "jxreason")
                    {
                        signal["JxCauseDesc"]             = dd.Value.ToString();
                        signal["CompleteNameReason_Done"] = "true";
                        //record
                        Dictionary <string, string> record1 = new Dictionary <string, string>();
                        record1["username"] = (Session["User"] as EquipModel.Entities.Person_Info).Person_Name;
                        record1["time"]     = DateTime.Now.ToString();
                        //submit
                        CWFEngine.SubmitSignal(Convert.ToInt32(id), signal, record1);
                    }
                    if (dd.Key == "xcconfirm")
                    {
                        string[] result = dd.Value.ToString().Split(new char[] { '$' });
                        signal["XcConfirm_Result"] = result[0];
                        if (result.Length > 1)
                        {
                            signal["XcConfirm_Reason"] = result[1];
                        }
                        //record
                        Dictionary <string, string> record1 = new Dictionary <string, string>();
                        record1["username"] = (Session["User"] as EquipModel.Entities.Person_Info).Person_Name;
                        record1["time"]     = DateTime.Now.ToString();
                        //submit
                        CWFEngine.SubmitSignal(Convert.ToInt32(id), signal, record1);
                    }
                    if (dd.Key == "kkconfirm")
                    {
                        if (dd.Value.ToString() == "")
                        {
                            continue;
                        }
                        string[] result = dd.Value.ToString().Split(new char[] { '$' });
                        signal["KkConfirm_Result"] = result[0];
                        if (result.Length > 1)
                        {
                            signal["KkConfirm_Reason"] = result[1];
                        }
                        //record
                        Dictionary <string, string> record1 = new Dictionary <string, string>();
                        record1["username"] = (Session["User"] as EquipModel.Entities.Person_Info).Person_Name;
                        record1["time"]     = DateTime.Now.ToString();
                        //submit
                        CWFEngine.SubmitSignal(Convert.ToInt32(id), signal, record1);
                    }
                    if (dd.Key == "zytdconfirm")
                    {
                        if (dd.Value.ToString() == "")
                        {
                            continue;
                        }
                        string[] result = dd.Value.ToString().Split(new char[] { '$' });
                        signal["ZytdConfirm_Result"] = result[0];
                        if (result.Length > 1)
                        {
                            signal["ZytdConfirm_Reason"] = result[1];
                        }


                        //record
                        Dictionary <string, string> record1 = new Dictionary <string, string>();
                        record1["username"] = (Session["User"] as EquipModel.Entities.Person_Info).Person_Name;
                        record1["time"]     = DateTime.Now.ToString();
                        //submit
                        CWFEngine.SubmitSignal(Convert.ToInt32(id), signal, record1);
                    }
                    if (dd.Key == "notice_order")
                    {
                        if (dd.Value.ToString() == "")
                        {
                            continue;
                        }
                        signal["NoticeOrder"] = "00" + dd.Value.ToString();
                        GD_InfoModal res = erp.getGD_Modal_Notice("00" + dd.Value.ToString());
                        if (res != null)
                        {
                            signal["JobOrder"] = res.GD_Id;
                        }

                        //record
                        Dictionary <string, string> record1 = new Dictionary <string, string>();
                        record1["username"] = (Session["User"] as EquipModel.Entities.Person_Info).Person_Name;
                        record1["time"]     = DateTime.Now.ToString();
                        //submit
                        CWFEngine.SubmitSignal(Convert.ToInt32(id), signal, record1);
                    }
                    if (dd.Key == "job_order")
                    {
                        if (dd.Value.ToString() == "")
                        {
                            continue;
                        }
                        signal["JobOrder"] = "00" + dd.Value.ToString();
                        GD_InfoModal res = erp.getGD_Modal_GDId("00" + dd.Value.ToString());
                        if (res != null)
                        {
                            signal["NoticeOrder"] = res.GD_Notice_Id;
                        }

                        //record
                        Dictionary <string, string> record1 = new Dictionary <string, string>();
                        record1["username"] = (Session["User"] as EquipModel.Entities.Person_Info).Person_Name;
                        record1["time"]     = DateTime.Now.ToString();
                        //submit
                        CWFEngine.SubmitSignal(Convert.ToInt32(id), signal, record1);
                    }
                    //if (dd.Key == "JumpA8dot2T")
                    //{
                    //    //补充跳转A8dot2的变量,Cj_Name,Zy_Type,Zy_SubType
                    //    Dictionary<string, object> paras1 = new Dictionary<string, object>();
                    //    paras1["Zz_Name"] = null;
                    //    paras1["Equip_GyCode"] = null;
                    //    paras1["Equip_Code"] = null;
                    //    paras1["Plan_Name"] = null;
                    //    UI_WFEntity_Info wfei = CWFEngine.GetWorkFlowEntityWithParams(id, paras1);
                    //    //获取设备专业类别和子类别及设备所属车间
                    //    EquipManagment tm = new EquipManagment();
                    //    Equip_Info getZy = tm.getEquip_ByGyCode(paras1["Equip_GyCode"].ToString());
                    //    signal["Zy_Type"] = getZy.Equip_Specialty;
                    //    signal["Zy_SubType"] = getZy.Equip_PhaseB;
                    //    signal["Equip_Type"] = getZy.Equip_Type;
                    //    //EA_Name_EA_Id= tm.getEquip(paras1["Zz_Name"].ToString()).EA_Parent.EA_Id;
                    //    signal["Cj_Name"] = tm.getEquip(paras1["Zz_Name"].ToString());
                    //    signal["Plan_Name"] = paras1["Plan_Name"].ToString();
                    //    signal["JxdwAttachPlanOrder_Done"] = dd.Value.ToString();
                    //    //record
                    //    Dictionary<string, string> record1 = new Dictionary<string, string>();
                    //    record1["username"] = (Session["User"] as EquipModel.Entities.Person_Info).Person_Name;
                    //    record1["time"] = DateTime.Now.ToString();
                    //    //submit
                    //    CWFEngine.SubmitSignal(Convert.ToInt32(id), signal, record1);
                    //}
                }
            }


            Dictionary <string, object> paras = new Dictionary <string, object>();

            paras["Zz_Name"]            = null;
            paras["Equip_GyCode"]       = null;
            paras["Equip_Code"]         = null;
            paras["Equip_Type"]         = null;
            paras["Equip_ABCMark"]      = null;
            paras["Plan_Name"]          = null;
            paras["JxCauseDesc"]        = null;
            paras["XcConfirm_Result"]   = null;
            paras["KkConfirm_Result"]   = null;
            paras["ZytdConfirm_Result"] = null;
            paras["JobOrder"]           = null;
            paras["NoticeOrder"]        = null;
            if (wfe_id != -1)
            {
                WorkFlows                   wfsd = new WorkFlows();
                UI_WFEntity_Info            wfei = CWFEngine.GetWorkFlowEntityWithParams(wfe_id, paras);
                Dictionary <string, object> m_kv = new Dictionary <string, object>();
                Mission         db_miss          = wfsd.GetWFEntityMissions(wfe_id).Last();//获取该实体最后一个任务
                int             UserId           = (Session["User"] as EquipModel.Entities.Person_Info).Person_Id;
                PersonManagment pm = new PersonManagment();
                EquipBLL.AdminManagment.PersonManagment.P_viewModal pv = pm.Get_PersonModal(UserId);

                m_kv["index_Id"]     = wfe_id;
                m_kv["zz_name"]      = paras["Zz_Name"].ToString();
                m_kv["sb_gycode"]    = paras["Equip_GyCode"].ToString();
                m_kv["sb_code"]      = paras["Equip_Code"].ToString();
                m_kv["sb_type"]      = paras["Equip_Type"].ToString();
                m_kv["sb_ABCMark"]   = paras["Equip_ABCMark"].ToString();
                m_kv["plan_name"]    = paras["Plan_Name"].ToString();
                m_kv["jxreason"]     = paras["JxCauseDesc"].ToString();
                m_kv["xcconfirm"]    = paras["XcConfirm_Result"].ToString();
                m_kv["kkconfirm"]    = paras["KkConfirm_Result"].ToString();
                m_kv["zytdconfirm"]  = paras["ZytdConfirm_Result"].ToString();
                m_kv["job_order"]    = paras["JobOrder"].ToString();
                m_kv["notice_order"] = paras["NoticeOrder"].ToString();
                m_kv["missionname"]  = db_miss.Miss_Desc;
                m_kv["role"]         = pv.Role_Names;
                dt.data.Add(m_kv);
            }
            return(dt);
        }
Exemple #20
0
        public Index_ModelforA15 getRecord()
        {
            Index_ModelforA15 RecordforA15 = new Index_ModelforA15();
            //ViewBag.curtime = DateTime.Now.ToString();
            int UserId = (Session["User"] as EquipModel.Entities.Person_Info).Person_Id;
            PersonManagment pm = new PersonManagment();
            EquipBLL.AdminManagment.PersonManagment.P_viewModal pv = pm.Get_PersonModal(UserId);
            RecordforA15.Am=new List<A15dot1Tab>();
            if (pv.Role_Names.Contains("可靠性工程师") || pv.Role_Names.Contains("检维修人员"))
                RecordforA15.isSubmit = 1;
            else
                RecordforA15.isSubmit = 0;
            if (pv.Role_Names.Contains("可靠性工程师"))
                RecordforA15.kkxgcs = 1;
            else
                RecordforA15.kkxgcs = 0;
            List<string> cjname = new List<string>();
            List<Equip_Archi> EA = pm.Get_Person_Cj(UserId);
            foreach (var ea in EA)
            {
                cjname.Add(ea.EA_Name);
            }

            List<A15dot1Tab> miss = Jx.GetJxItem(pv.Role_Names,pv.Department_Name,pv.Person_Name);
            foreach (var item in miss)
            {
                A15dot1Tab a = new A15dot1Tab();
                a.timesNonPlanStop = item.timesNonPlanStop;
                a.scoreDeductFaultIntensity = item.scoreDeductFaultIntensity;
                a.rateBigUnitFault = item.rateBigUnitFault;
                a.rateFaultMaintenance = item.rateFaultMaintenance;
                a.MTBF = item.MTBF;
                a.rateEquipUse = item.rateEquipUse;
                a.rateUrgentRepairWorkHour = item.rateUrgentRepairWorkHour;
                a.hourWorkOrderFinish = item.hourWorkOrderFinish;
                a.avgLifeSpanSeal = item.avgLifeSpanSeal;
                a.avgLifeSpanAxle = item.avgLifeSpanAxle;
                a.percentEquipAvailability = item.percentEquipAvailability;
                a.percentPassOnetimeRepair = item.percentPassOnetimeRepair;
                a.avgEfficiencyPump = item.avgEfficiencyPump;
                a.avgEfficiencyUnit = item.avgEfficiencyUnit;
                a.hiddenDangerInvestigation = item.hiddenDangerInvestigation;
                a.rateLoad = item.rateLoad;
                a.gyChange = item.gyChange;
                a.equipChange = item.equipChange;
                a.otherDescription = item.otherDescription;
                a.evaluateEquipRunStaeDesc = item.evaluateEquipRunStaeDesc;
                a.evaluateEquipRunStaeImgPath = item.evaluateEquipRunStaeImgPath;
                a.reliabilityConclusion = item.reliabilityConclusion;
                a.jdcAdviseImproveMeasures = item.jdcAdviseImproveMeasures;
                a.submitDepartment = item.submitDepartment;
                a.submitUser = item.submitUser;
                a.submitTime = item.submitTime;
                a.jdcOperator = item.jdcOperator;
                a.jdcOperateTime = item.jdcOperateTime;
                a.reportType = item.reportType;
                a.temp1 = Convert.ToString(miss.IndexOf(item) + 1);
                a.submitUser = item.submitUser;
                a.submitTime = item.submitTime;
                a.state = item.state;
                a.Id = item.Id;
                RecordforA15.Am.Add(a);
            }
            
            RecordforA15.Hm = new List<A15dot1Tab>();
            List<A15dot1Tab> His = Jx.GetHisJxItem(pv.Role_Names, pv.Department_Name, pv.Person_Name);
            foreach (var item in His)
            {
                A15dot1Tab a = new A15dot1Tab();
                a.Id = item.Id;
                a.state = item.state;
                a.jdcOperateTime = item.jdcOperateTime;
                a.jdcOperator = item.jdcOperator;
                a.temp1 = Convert.ToString(His.IndexOf(item) + 1);
                RecordforA15.Hm.Add(a);
            }

            return RecordforA15;
        }
Exemple #21
0
          public ActionResult DSZzSubmit(string wfe_id)
          {
              submitmodel sm = new submitmodel();
              ViewBag.curtime = DateTime.Now;
              ViewBag.curuser = (Session["User"] as EquipModel.Entities.Person_Info).Person_Name;
              int UserId = (Session["User"] as EquipModel.Entities.Person_Info).Person_Id;
              PersonManagment pm = new PersonManagment();
              EquipBLL.AdminManagment.PersonManagment.P_viewModal pv = pm.Get_PersonModal(UserId);
              if (pv.Role_Names.Contains("可靠性工程师"))
                  sm.kkxgcs = 1;
              if (pv.Role_Names.Contains("检维修人员"))
                  sm.jwxry = 1;
              ERPInfoManagement erp = new ERPInfoManagement();
              EquipArchiManagment em = new EquipArchiManagment();
              UI_MISSION mi = CWFEngine.GetActiveMission<Person_Info>(int.Parse(wfe_id), ((IObjectContextAdapter)(new EquipWebContext())).ObjectContext);
              Dictionary<string, object> mi_params = mi.Miss_Params;
              ViewBag.Pqname = mi.Miss_Params["Pqname"].ToString();
              string ea_code = em.getEa_codebyname(mi.Miss_Params["Pqname"].ToString());
              ViewBag.timesNonPlanStop=erp.getNoticesYx_1(mi.Miss_Params["Pqname"].ToString());
              ViewBag.scoreDeductFaultIntensity = (erp.getNoticesYx_1(mi.Miss_Params["Pqname"].ToString()) * 50) + (erp.getNoticeYx_2(mi.Miss_Params["Pqname"].ToString()) * 30) + (erp.getNoticeYx_3(mi.Miss_Params["Pqname"].ToString()) * 20) + (erp.getNoticeYx_4(mi.Miss_Params["Pqname"].ToString()) * 5);
              ViewBag.rateFaultMaintenance = erp.getFaultRation(mi.Miss_Params["Pqname"].ToString());
              ViewBag.MTBF = erp.getNonFaultInterVal(mi.Miss_Params["Pqname"].ToString());
              ViewBag.rateEquipUse = erp.DeliverRatio(mi.Miss_Params["Pqname"].ToString());
              ViewBag.rateBigUnitFault = erp.bigEquipsRatio(mi.Miss_Params["Pqname"].ToString());
              ViewBag.wfe_id = wfe_id;
              TablesManagment tm = new TablesManagment();
              EquipManagment Em = new EquipManagment();
              List<EANummodel> E = Em.getequipnum_byarchi();
              List<Equip_Archi> AllCj_List = Em.GetAllCj();

              List<WebApp.Controllers.A5dot1Controller.NameandNum> cj = new List<WebApp.Controllers.A5dot1Controller.NameandNum>();
              List<WebApp.Controllers.A5dot1Controller.NameandNum> pq = new List<WebApp.Controllers.A5dot1Controller.NameandNum>();




              for (int i = 0; i < AllCj_List.Count; i++)
              {
                  int count = 0;
                  WebApp.Controllers.A5dot1Controller.NameandNum temp1 = new WebApp.Controllers.A5dot1Controller.NameandNum();
                  temp1.name = AllCj_List[i].EA_Name;
                  for (int j = 0; j < E.Count; j++)
                  {
                      if (AllCj_List[i].EA_Id == Em.getEA_parentid(E[j].EA_Id))
                          count += E[j].Equip_Num;
                  }
                  temp1.Equip_Num = count;
                  cj.Add(temp1);
                  count = 0;
              }
            
              WebApp.Controllers.A5dot1Controller.NameandNum temp = new WebApp.Controllers.A5dot1Controller.NameandNum();
              temp.name = mi.Miss_Params["Pqname"].ToString();
              List<Pq_Zz_map> Pq_Zz_map = Em.GetZzsofPq(mi.Miss_Params["Pqname"].ToString());
              int count1 = 0;
              for (int j = 0; j < Pq_Zz_map.Count; j++)
              {
                 
                  for (int z = 0; z < E.Count; z++)
                  {
                      if (Pq_Zz_map[j].Zz_Name == Em.getEa_namebyid(E[z].EA_Id))
                          count1 += E[z].Equip_Num;
                  }
              }
              temp.Equip_Num = count1;
              pq.Add(temp);

              double pq_bwh = 0.00;
              for (int i = 0; i < pq.Count; i++)
              {
                  List<A5dot1Tab1> pq_list = tm.get_pq_bwh(pq[i].name, pq[i].Equip_Num);
                  double pq_bxhcount = 0;
                  int wzg_count = 0;
                  if (pq_list.Count > 0)
                  {
                      pq_bxhcount = 0;
                      wzg_count = 0;
                      string sbcode_temp = pq_list[0].sbCode;
                      for (int j = 0; j < pq_list.Count; j++)
                      {
                          pq_list = tm.get_cj_bwh(cj[i].name, cj[i].Equip_Num);
                          if (pq_list[j].temp1 == null)
                          {
                              List<A5dot1Tab1> cj_bycode = tm.GetAll1_bycode(pq_list[j].sbCode);
                              for (int k = 0; k < cj_bycode.Count; k++)
                              {
                                  if (cj_bycode[k].isRectified == 0)
                                  {
                                      wzg_count++;
                                  }
                                  tm.modifytemp1_byid(cj_bycode[k].Id, "已合并");

                              }
                              if (wzg_count > 0)
                              {
                                  pq_bxhcount++;
                              }
                              wzg_count = 0;
                          }

                          // cjbwh.Add(f);
                      }
                  }

                  for (int n = 0; n < pq_list.Count; n++)
                  {
                      tm.modifytemp1_byid(pq_list[n].Id, null);
                  }
                  pq_bwh=Math.Round(((double)pq_bxhcount / pq[i].Equip_Num), 6);
              }
              ViewBag.Pq_bwh = (1-pq_bwh)*100;
              return View(sm);
          }
Exemple #22
0
        public Index_ModelforA5dot2 getRecord()
        {
            Index_ModelforA5dot2 RecordforA5dot2 = new Index_ModelforA5dot2();

            RecordforA5dot2.time = DateTime.Now.ToString();
            //ViewBag.curuser = (Session["User"] as EquipModel.Entities.Person_Info).Person_Name;
            RecordforA5dot2.Am = new List <A5dot2Tab1>();
            int             UserId = (Session["User"] as EquipModel.Entities.Person_Info).Person_Id;
            PersonManagment pm     = new PersonManagment();

            EquipBLL.AdminManagment.PersonManagment.P_viewModal pv = pm.Get_PersonModal(UserId);
            if (pv.Role_Names.Contains("检维修人员") || pv.Role_Names.Contains("现场工程师"))
            {
                RecordforA5dot2.jwxry = 1;
            }
            else
            {
                RecordforA5dot2.jwxry = 0;
            }
            if (pv.Role_Names.Contains("机动处"))
            {
                RecordforA5dot2.jdc = 1;
            }
            else
            {
                RecordforA5dot2.kxxgcs = 0;
            }
            if (pv.Department_Name.Contains("机动处"))
            {
                RecordforA5dot2.jdc = 1;
            }
            else
            {
                RecordforA5dot2.jdc = 0;
            }
            if (pv.Role_Names.Contains("可靠性工程师"))
            {
                List <string>      cjname = new List <string>();
                List <Equip_Archi> EA     = pm.Get_Person_Cj(UserId);
                foreach (var ea in EA)
                {
                    cjname.Add(ea.EA_Name);
                }
                List <A5dot2Tab1> miss = Sx.GetSxItem(cjname);
                foreach (var item in miss)
                {
                    A5dot2Tab1 a = new A5dot2Tab1();
                    a.zzName       = item.zzName;
                    a.sbGyCode     = item.sbGyCode;
                    a.sbCode       = item.sbCode;
                    a.jxUserName   = item.jxUserName;
                    a.jxSubmitTime = item.jxSubmitTime;
                    a.temp1        = Convert.ToString(miss.IndexOf(item) + 1);
                    a.Id           = item.Id;
                    a.temp2        = DateTime.Now.ToString();
                    RecordforA5dot2.Am.Add(a);
                }
                RecordforA5dot2.Hm = new List <A5dot2Tab1>();
                // List<A5dot2Tab1> His = Jx.GetHisJxItem();
                // foreach (var item in His)
                // {
                //     A5dot2Tab1 a = new A5dot2Tab1();
                //     a.Id = item.Id;
                //     a.state = item.state;
                //
                //     a.temp1 = Convert.ToString(miss.IndexOf(item) + 1);
                //    RecordforA5dot2.Hm.Add(a);
                // }

                return(RecordforA5dot2);
            }
            return(RecordforA5dot2);
        }
        public Index_ModelforA15 getRecord()
        {
            Index_ModelforA15 RecordforA15 = new Index_ModelforA15();
            //ViewBag.curtime = DateTime.Now.ToString();
            int             UserId = (Session["User"] as EquipModel.Entities.Person_Info).Person_Id;
            PersonManagment pm     = new PersonManagment();

            EquipBLL.AdminManagment.PersonManagment.P_viewModal pv = pm.Get_PersonModal(UserId);
            RecordforA15.Am = new List <A15dot1TabQiYe>();
            if (pv.Role_Names.Contains("可靠性工程师") || pv.Role_Names.Contains("检维修人员"))
            {
                RecordforA15.isSubmit = 1;
            }
            else
            {
                RecordforA15.isSubmit = 0;
            }
            if (pv.Role_Names.Contains("可靠性工程师"))
            {
                RecordforA15.kkxgcs = 1;
            }
            else
            {
                RecordforA15.kkxgcs = 0;
            }
            List <string>      cjname = new List <string>();
            List <Equip_Archi> EA     = pm.Get_Person_Cj(UserId);

            foreach (var ea in EA)
            {
                cjname.Add(ea.EA_Name);
            }

            List <A15dot1TabQiYe> miss = Jx.GetJxItem(pv.Role_Names, pv.Department_Name, pv.Person_Name, cjname);

            foreach (var item in miss)
            {
                A15dot1TabQiYe a = new A15dot1TabQiYe();
                a.zzkkxzs          = item.zzkkxzs;
                a.wxfyzs           = item.wxfyzs;
                a.qtlxbmfxhl       = item.qtlxbmfxhl;
                a.qtlhsbgsghl      = item.qtlhsbgsghl;
                a.ybsjkzl          = item.ybsjkzl;
                a.sjs              = item.sjs;
                a.gzqdkf           = item.gzqdkf;
                a.xmyql            = item.xmyql;
                a.pxjnl            = item.pxjnl;
                a.submitDepartment = item.submitDepartment;
                a.submitUser       = item.submitUser;
                a.submitTime       = item.submitTime;
                a.jdcOperator      = item.jdcOperator;
                a.jdcOperateTime   = item.jdcOperateTime;
                a.reportType       = item.reportType;
                a.temp1            = Convert.ToString(miss.IndexOf(item) + 1);
                a.submitUser       = item.submitUser;
                a.submitTime       = item.submitTime;
                a.state            = item.state;
                a.Id = item.Id;
                RecordforA15.Am.Add(a);
            }

            RecordforA15.Hm = new List <A15dot1TabQiYe>();
            List <A15dot1TabQiYe> His = Jx.GetHisJxItem(pv.Role_Names, pv.Department_Name, pv.Person_Name);

            foreach (var item in His)
            {
                A15dot1TabQiYe a = new A15dot1TabQiYe();
                a.Id             = item.Id;
                a.state          = item.state;
                a.jdcOperateTime = item.jdcOperateTime;
                a.jdcOperator    = item.jdcOperator;
                a.temp1          = Convert.ToString(His.IndexOf(item) + 1);
                RecordforA15.Hm.Add(a);
            }

            return(RecordforA15);
        }