Ejemplo n.º 1
0
        public void SCANTPM()
        {
            ZBCFUN_CPBZ_READ res = ServicModel.PD_GD.get_CPBZ_READ(smtextBox.Text.Trim().ToUpper(), getToken());

            if (res.MES_RETURN.TYPE.Equals("S"))
            {
                if (res.ET_RT.Length > 0 && res.ET_RT != null)
                {
                    MES_SY_GZZX_WLLB wllbModel = new MES_SY_GZZX_WLLB();
                    wllbModel.WLLBID = res.ES_HEADER.WLLB;
                    wllbModel.GC     = res.ES_HEADER.WERKS;
                    wllbModel.GZZXBH = res.ET_RT[0].ARBPL;
                    MES_SY_GZZX_WLLB_SELECT wllbRes = ServicModel.SY_GZZX_WLLB.SELECT(wllbModel, getToken());

                    MES_SY_GC gc_model = new MES_SY_GC();
                    gc_model.GC = res.ES_HEADER.WERKS;
                    MES_SY_GC[] gc_res    = ServicModel.SY_GC.read(gc_model, getToken());
                    MES_SY_GZZX gzzxmodel = new MES_SY_GZZX();
                    gzzxmodel.GZZXBH = res.ET_RT[0].ARBPL;
                    gzzxmodel.GC     = res.ES_HEADER.WERKS;
                    MES_SY_GZZX[] gzzx_res = ServicModel.SY_GZZX.SELECT(gzzxmodel, getToken());


                    ini.IniWriteValue(ini.Section_UserInfo, "gzzxvalue", res.ET_RT[0].ARBPL);
                    ini.IniWriteValue(ini.Section_UserInfo, "gzzxtext", gzzx_res[0].GZZXMS);
                    ini.IniWriteValue(ini.Section_GC, "value", res.ES_HEADER.WERKS);
                    ini.IniWriteValue(ini.Section_GC, "text", gc_res[0].GCMS);

                    if (wllbRes.MES_RETURN.TYPE.Equals("S"))
                    {
                        if (wllbRes.MES_SY_GZZX_WLLB != null && wllbRes.MES_SY_GZZX_WLLB.Length == 1)
                        {
                            if (block != null)
                            {
                                block(new MES_PD_SCRW_LIST(), wllbRes.MES_SY_GZZX_WLLB[0].RIGHTID, res.ES_HEADER.WERKS, res.ET_RT[0].ARBPL, res.ES_HEADER.WLLB, this, smtextBox.Text.Trim().ToUpper());
                                //this.Close();
                            }
                        }
                        else
                        {
                            //ShowMeg("获取工单对应权限异常,请联系管理员");
                            ShowMeg(q(Msg_Type.msggdroleexcept));
                        }
                    }
                }
                //res.ES_HEADER.WERKS
            }
            else
            {
                ShowMeg(res.MES_RETURN.MESSAGE);
            }
        }
Ejemplo n.º 2
0
        public string GET_WLLB(string GC, string GZZXBH)
        {
            string           rst   = "";
            string           token = AppClass.GetSession("token").ToString();
            MES_SY_GZZX_WLLB model_MES_SY_GZZX_WLLB = new MES_SY_GZZX_WLLB();

            model_MES_SY_GZZX_WLLB.GC     = GC;
            model_MES_SY_GZZX_WLLB.GZZXBH = GZZXBH;
            MES_SY_GZZX_WLLB_SELECT rst_MES_SY_GZZX_WLLB_SELECT = mesModels.SY_GZZX_WLLB.SELECT(model_MES_SY_GZZX_WLLB, token);

            rst = Newtonsoft.Json.JsonConvert.SerializeObject(rst_MES_SY_GZZX_WLLB_SELECT);
            return(rst);
        }
Ejemplo n.º 3
0
        public void SCANSBBH()
        {
            MES_SY_GZZX_SBH model = new MES_SY_GZZX_SBH();

            model.SBBH = smtextBox.Text.Trim();
            MES_SY_GZZX_SBH[] sbhREs = ServicModel.SY_GZZX_SBH.SELECT(model, getToken());
            if (sbhREs.Length == 1)
            {
                MES_SY_GZZX_SBH res = sbhREs[0];
                ini.IniWriteValue(ini.Section_UserInfo, "gzzxvalue", res.GZZXBH);
                ini.IniWriteValue(ini.Section_UserInfo, "gzzxtext", res.GZZXMS);
                ini.IniWriteValue(ini.Section_GC, "value", res.GC);
                MES_SY_GC gcmodel = new MES_SY_GC();
                gcmodel.GC = res.GC;
                MES_SY_GC[] gcres = ServicModel.SY_GC.read(gcmodel, getToken());
                if (gcres.Length == 1)
                {
                    ini.IniWriteValue(ini.Section_GC, "text", gcres[0].GCMS);

                    MES_PD_SCRW rwmodel = new MES_PD_SCRW();
                    rwmodel.SBBH = smtextBox.Text.Trim();;


                    //DateTime currentTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm");
                    //DateTime dt = DateTime.Now;
                    //dt = dt.AddHours(-4);
                    //string a = ServicModel.PUBLIC_FUNC.GET_TIME(getToken());
                    DateTime sy_dt = Convert.ToDateTime(ServicModel.PUBLIC_FUNC.GET_TIME(getToken())).AddHours(-4);
                    //sy_dt = sy_dt.AddHours(-4);
                    //string currentTime = dt.ToString("yyyy-MM-dd");
                    rwmodel.ZPRQ = sy_dt.ToString("yyyy-MM-dd");

                    SELECT_MES_PD_SCRW Smodel = ServicModel.PD_SCRW.SELECT_LAST(rwmodel, getToken());
                    if (Smodel.MES_RETURN.TYPE == "E")
                    {
                        ShowMeg(Smodel.MES_RETURN.MESSAGE);
                    }
                    else
                    {
                        MES_SY_GZZX_WLLB wllbModel = new MES_SY_GZZX_WLLB();
                        wllbModel.WLLBID = Smodel.MES_PD_SCRW_LIST[0].WLLB;
                        wllbModel.GC     = Smodel.MES_PD_SCRW_LIST[0].GC;
                        wllbModel.GZZXBH = Smodel.MES_PD_SCRW_LIST[0].GZZXBH;
                        MES_SY_GZZX_WLLB_SELECT wllbRes = ServicModel.SY_GZZX_WLLB.SELECT(wllbModel, getToken());
                        if (wllbRes.MES_RETURN.TYPE.Equals("S"))
                        {
                            if (wllbRes.MES_SY_GZZX_WLLB != null && wllbRes.MES_SY_GZZX_WLLB.Length == 1)
                            {
                                if (block != null)
                                {
                                    block(Smodel.MES_PD_SCRW_LIST[0], wllbRes.MES_SY_GZZX_WLLB[0].RIGHTID, "", "", 0, this, smtextBox.Text.Trim().ToUpper());
                                    //this.Close();
                                }
                            }
                            else
                            {
                                //ShowMeg("扫描设备号获取任务单权限异常,请联系管理员");
                                ShowMeg(q(Msg_Type.msgrwdroleexcept));
                            }
                        }
                        else
                        {
                            ShowMeg(wllbRes.MES_RETURN.MESSAGE);
                        }
                    }
                }
                else
                {
                    //ShowMeg("扫描的条码得到的不是唯一的工厂名字");
                    ShowMeg(q(Msg_Type.msgtmnoonly));
                }
            }
            else
            {
                //ShowMeg("扫描的条码不是正确设备号");
                ShowMeg(q(Msg_Type.msgscantmnosbh));
            }
        }
Ejemplo n.º 4
0
        public void ChangeRW()
        {
            MES_PD_SCRW model = new MES_PD_SCRW();

            model.RWBH    = smtextBox.Text.Trim().ToUpper();
            model.STAFFID = Convert.ToInt32(getUserInfo("staffid"));
            //model.ZPRQ = DateTime.Now.ToString("yyyy-MM-dd");
            SELECT_MES_PD_SCRW res = ServicModel.PD_SCRW.SELECT_BY_ROLE(model, getToken());

            if (res.MES_RETURN.TYPE.Equals("S"))
            {
                if (res.MES_PD_SCRW_LIST.Length == 1)
                {
                    if (res.MES_PD_SCRW_LIST[0].WLLBNAME.Equals("成品"))
                    {
                        //ShowMeg("成品请扫描<生产入库标识>");
                        ShowMeg(q(Msg_Type.msgcpscanrkbs));
                        return;
                    }
                    MES_SY_GZZX_WLLB wllbModel = new MES_SY_GZZX_WLLB();
                    wllbModel.WLLBID = res.MES_PD_SCRW_LIST[0].WLLB;
                    wllbModel.GC     = res.MES_PD_SCRW_LIST[0].GC;
                    wllbModel.GZZXBH = res.MES_PD_SCRW_LIST[0].GZZXBH;


                    //ini.IniWriteValue(ini.Section_GC, "text", Convert.ToString(gccomboBox.Text.Trim()));
                    MES_SY_GC gc_model = new MES_SY_GC();
                    gc_model.GC = res.MES_PD_SCRW_LIST[0].GC;
                    MES_SY_GC[] gc_res = ServicModel.SY_GC.read(gc_model, getToken());
                    ini.IniWriteValue(ini.Section_UserInfo, "gzzxvalue", res.MES_PD_SCRW_LIST[0].GZZXBH);
                    ini.IniWriteValue(ini.Section_UserInfo, "gzzxtext", res.MES_PD_SCRW_LIST[0].GZZXNAME);
                    ini.IniWriteValue(ini.Section_GC, "value", res.MES_PD_SCRW_LIST[0].GC);
                    ini.IniWriteValue(ini.Section_GC, "text", gc_res[0].GCMS);
                    MES_SY_GZZX_WLLB_SELECT wllbRes = ServicModel.SY_GZZX_WLLB.SELECT(wllbModel, getToken());
                    if (wllbRes.MES_RETURN.TYPE.Equals("S"))
                    {
                        if (wllbRes.MES_SY_GZZX_WLLB != null && wllbRes.MES_SY_GZZX_WLLB.Length == 1)
                        {
                            if (block != null)
                            {
                                block(res.MES_PD_SCRW_LIST[0], wllbRes.MES_SY_GZZX_WLLB[0].RIGHTID, "", "", 0, this, smtextBox.Text.Trim().ToUpper());
                                //this.Close();
                            }
                        }
                        else
                        {
                            //ShowMeg("获取任务单权限异常,请联系管理员");
                            ShowMeg(q(Msg_Type.msgrwdroleexcept));
                        }
                    }
                    else
                    {
                        ShowMeg(wllbRes.MES_RETURN.MESSAGE);
                    }
                }
                else
                {
                    //ShowMeg("获得任务单异常,请联系管理员");
                    ShowMeg(q(Msg_Type.msgrwdroleexcept));
                }
            }
            else
            {
                ShowMeg(res.MES_RETURN.MESSAGE);
            }
        }
Ejemplo n.º 5
0
        public void SCANGD()
        {
            //if (gccomboBox.SelectedValue.Equals("0"))
            //{
            //    //&&  gccomboBox.SelectedValue.Equals("0")
            //    //ShowMeg("请选择工单对应的工厂");
            //    ShowMeg(q(Msg_Type.msggdgc));
            //    return;
            //}
            //string gc =  Convert.ToString(gccomboBox.SelectedValue);


            //ZBCFUN_GDJGXX_READ sap_res = ServicModel.PD_GD.get_GDJGXX_BYERPNO_GC(gc, smtextBox.Text.Trim().ToUpper(), getToken());
            ZBCFUN_GDJGXX_READ sap_res = ServicModel.PD_GD.get_GDJGXX_BYERPNO(smtextBox.Text.Trim().ToUpper(), getToken());

            if (!sap_res.MES_RETURN.TYPE.Equals("S"))
            {
                ShowMeg(sap_res.MES_RETURN.MESSAGE);
                return;
            }
            MES_PD_GD gdmodel = new MES_PD_GD();

            gdmodel.ERPNO = smtextBox.Text.Trim().ToUpper();
            gdmodel.JLR   = Convert.ToInt32(getUserInfo("staffid"));
            SELECT_MES_PD_GD res = ServicModel.PD_GD.SELECT_BY_ERPNO_SYNC(gdmodel, getToken());

            if (res.MES_RETURN.TYPE.Equals("S"))
            {
                if (res.MES_PD_GD_LIST.Length == 1)
                {
                    MES_PD_GD_LIST node = res.MES_PD_GD_LIST[0];
                    if (node.WLLBNAME.Equals("成品"))
                    {
                        //ShowMeg("成品请扫描<生产入库标识>");
                        ShowMeg(q(Msg_Type.msgcpscanrkbs));
                        return;
                    }
                    if (block != null)
                    {
                        MES_SY_GZZX_WLLB wllbModel = new MES_SY_GZZX_WLLB();
                        wllbModel.WLLBID = node.WLLB;
                        wllbModel.GC     = node.GC;
                        wllbModel.GZZXBH = node.GZZXBH;
                        MES_SY_GZZX_WLLB_SELECT wllbRes = ServicModel.SY_GZZX_WLLB.SELECT(wllbModel, getToken());

                        MES_SY_GC gc_model = new MES_SY_GC();
                        gc_model.GC = node.GC;
                        MES_SY_GC[] gc_res    = ServicModel.SY_GC.read(gc_model, getToken());
                        MES_SY_GZZX gzzxmodel = new MES_SY_GZZX();
                        gzzxmodel.GZZXBH = node.GZZXBH;
                        gzzxmodel.GC     = node.GC;
                        MES_SY_GZZX[] gzzx_res = ServicModel.SY_GZZX.SELECT(gzzxmodel, getToken());



                        ini.IniWriteValue(ini.Section_UserInfo, "gzzxvalue", node.GZZXBH);
                        ini.IniWriteValue(ini.Section_UserInfo, "gzzxtext", gzzx_res[0].GZZXMS);
                        ini.IniWriteValue(ini.Section_GC, "value", node.GC);
                        ini.IniWriteValue(ini.Section_GC, "text", gc_res[0].GCMS);



                        if (wllbRes.MES_RETURN.TYPE.Equals("S"))
                        {
                            if (wllbRes.MES_SY_GZZX_WLLB != null && wllbRes.MES_SY_GZZX_WLLB.Length == 1)
                            {
                                block(new MES_PD_SCRW_LIST(), wllbRes.MES_SY_GZZX_WLLB[0].RIGHTID, node.GC, node.GZZXBH, node.WLLB, this, smtextBox.Text.Trim().ToUpper());
                                //this.Close();
                            }
                            else
                            {
                                //ShowMeg("获取工单对应权限异常,请联系管理员");
                                ShowMeg(q(Msg_Type.msggdroleexcept));
                            }
                        }
                        else
                        {
                            ShowMeg(wllbRes.MES_RETURN.MESSAGE);
                        }
                    }
                }
                else
                {
                    //ShowMeg("工单获取的工单信息异常,请联系管理员");
                    ShowMeg(q(Msg_Type.msggdroleexcept));
                }
            }
            else
            {
                ShowMeg(res.MES_RETURN.MESSAGE);
            }
        }
Ejemplo n.º 6
0
        public ActionResult Assign_WorkOrder()
        {
            int    STAFFID = Convert.ToInt32(AppClass.GetSession("STAFFID"));
            string token   = AppClass.GetSession("token").ToString();
            MODEL_Assign_WorkOrder model = new MODEL_Assign_WorkOrder();

            AppClass.SetSession("location", 110);
            MES_SY_GC model_MES_SY_GC = new MES_SY_GC();

            model_MES_SY_GC.STAFFID = STAFFID;
            MES_SY_GC[] MES_SY_GC_list = mesModels.SY_GC.SELECT_BY_ROLE(model_MES_SY_GC, token);
            int         gzzxcount      = 0;

            if (MES_SY_GC_list.Length == 1)
            {
                MES_SY_GZZX model_MES_SY_GZZX = new MES_SY_GZZX();
                model_MES_SY_GZZX.GC      = MES_SY_GC_list[0].GC;
                model_MES_SY_GZZX.STAFFID = STAFFID;
                MES_SY_GZZX[] rst_MES_SY_GZZX = mesModels.SY_GZZX.SELECT_BY_ROLE(model_MES_SY_GZZX, token);
                model.GZXX = rst_MES_SY_GZZX;
                gzzxcount  = rst_MES_SY_GZZX.Length;
            }
            else
            {
                model.GZXX = new MES_SY_GZZX[0];
            }
            if (MES_SY_GC_list.Length == 1)
            {
                MES_SY_MATERIAL_GROUP model_MES_SY_MATERIAL_GROUP = new MES_SY_MATERIAL_GROUP();
                model_MES_SY_MATERIAL_GROUP.GC       = MES_SY_GC_list[0].GC;
                model_MES_SY_MATERIAL_GROUP.WLLBNAME = "密封圈";
                MES_SY_MATERIAL_GROUP_SELECT rst_MES_SY_MATERIAL_GROUP_SELECT = mesModels.SY_MATERIAL_GROUP.SELECT_USER(model_MES_SY_MATERIAL_GROUP, token);
                model.WLGROUP = rst_MES_SY_MATERIAL_GROUP_SELECT.MES_SY_MATERIAL_GROUP;
                if (rst_MES_SY_MATERIAL_GROUP_SELECT.MES_SY_MATERIAL_GROUP.Length == 1 && gzzxcount == 1)
                {
                    MES_SY_MATERIAL model_MES_SY_MATERIAL_LIST = new MES_SY_MATERIAL();
                    model_MES_SY_MATERIAL_LIST.GC      = MES_SY_GC_list[0].GC;
                    model_MES_SY_MATERIAL_LIST.WLGROUP = rst_MES_SY_MATERIAL_GROUP_SELECT.MES_SY_MATERIAL_GROUP[0].WLGROUP;
                    model_MES_SY_MATERIAL_LIST.GZZXBH  = model.GZXX[0].GZZXBH;
                    MES_SY_MATERIAL_SELECT rst_MES_SY_MATERIAL_SELECT = mesModels.SY_MATERIAL.SELECT_BY_GZZX(model_MES_SY_MATERIAL_LIST, token);
                    model.WL = rst_MES_SY_MATERIAL_SELECT.MES_SY_MATERIAL;
                }
                else
                {
                    model.WL = new MES_SY_MATERIAL_LIST[0];
                }
            }
            else
            {
                model.WLGROUP = new MES_SY_MATERIAL_GROUP[0];
            }
            if (MES_SY_GC_list.Length == 1)
            {
                MES_SY_TYPEMX model_MES_SY_TYPEMX = new MES_SY_TYPEMX();
                model_MES_SY_TYPEMX.GC     = MES_SY_GC_list[0].GC;
                model_MES_SY_TYPEMX.TYPEID = 2;
                MES_SY_TYPEMXLIST[] rst_MES_SY_TYPEMXLIST = mesModels.SY_TYPEMX.SELECT(model_MES_SY_TYPEMX, token);
                model.DW = rst_MES_SY_TYPEMXLIST;
            }
            else
            {
                model.DW = new MES_SY_TYPEMXLIST[0];
            }
            if (MES_SY_GC_list.Length == 1 && gzzxcount == 1)
            {
                MES_SY_GZZX_WLLB model_MES_SY_GZZX_WLLB = new MES_SY_GZZX_WLLB();
                model_MES_SY_GZZX_WLLB.GC     = MES_SY_GC_list[0].GC;
                model_MES_SY_GZZX_WLLB.GZZXBH = model.GZXX[0].GZZXBH;
                MES_SY_GZZX_WLLB_SELECT rst_MES_SY_GZZX_WLLB_SELECT = mesModels.SY_GZZX_WLLB.SELECT(model_MES_SY_GZZX_WLLB, token);
                model.WLLB = rst_MES_SY_GZZX_WLLB_SELECT.MES_SY_GZZX_WLLB;
            }
            else
            {
                model.WLLB = new MES_SY_GZZX_WLLB[0];
            }
            model.MES_SY_GC = MES_SY_GC_list;
            model.GZZXCOUNT = gzzxcount;
            ViewData.Model  = model;
            return(View());
        }