Ejemplo n.º 1
0
        public static string LabelStrA(string sid, string gnum)
        {
            string              r = "";
            string              city = "", code = "";
            B_SaleOrderBll      bsob  = new B_SaleOrderBll();
            B_AfterSaleOrderBll basob = new B_AfterSaleOrderBll();
            B_ProductionItemBll bpit  = new B_ProductionItemBll();
            SessionUserValidate iv    = SysValidateBll.ValidateSession();

            if (iv.f)
            {
                var o = bsob.Query(" and sid='" + sid + "'");
                if (o != null)
                {
                    city = o.city;
                    code = o.scode;
                }
                var ao = basob.Query(" and sid='" + sid + "'");
                if (ao != null)
                {
                    city = ao.city;
                    code = ao.scode;
                }
                B_GroupProduction bp = bgpb.Query(" and sid='" + sid + "' and gnum=" + gnum + " and icode like '01%'");
                B_GroupProduction bl = bgpb.Query(" and sid='" + sid + "' and gnum=" + gnum + " and icode like '05%'");
                if (bp != null)
                {
                    string c1 = "", c2 = "", blname = "";
                    if (bl != null)
                    {
                        blname = bl.iname;
                    }
                    B_ProductionItem ms1 = bpit.Query(" and psid='" + bp.psid + "' and ptype='m' and e_ptype='f' ");
                    if (ms1 != null)
                    {
                        c1 = ms1.height + "*" + ms1.width;
                    }
                    B_ProductionItem ms2 = bpit.Query(" and psid='" + bp.psid + "' and ptype='m' and e_ptype='s' ");
                    if (ms2 != null)
                    {
                        c2 = ms2.height + "*" + ms2.width;
                    }
                    r = "BqPrint://?BH=" + code + "&CP=" + bp.iname + "&WZ=" + bp.place + "&CC1=" + c1 + "&CC2=" + c2 + "&CZ=" + bp.mname + "&XH=" + bp.gnum + "&SJ=" + bp.locks + "&BL=" + blname + "&KX=" + bp.direction + "&CS=" + city + "&DT=" + DateTime.Now.ToString() + "&HY=" + bp.locktype + "&LX=PAdoor&ZX=" + gnum + "&IID=" + bp.id + "";
                }
            }
            else
            {
                r = "";
            }
            return(r);
        }
Ejemplo n.º 2
0
        public static string EditProductionAttr(string sid, string gnum)
        {
            string r = "";
            SessionUserValidate iv = SysValidateBll.ValidateSession();

            if (iv.f)
            {
                B_GroupProduction            b   = bgpb.Query(" and sid='" + sid + "' and gnum=" + gnum + "");
                List <B_GroupProductionAttr> lba = bgpab.QueryList(" and gsid='" + b.gsid + "'");
                if (lba != null)
                {
                    foreach (B_GroupProductionAttr a in lba)
                    {
                        r = r + a.acode + ";";
                    }
                    r = r.Substring(0, r.Length - 1);
                }
            }
            else
            {
                r = iv.badstr;
            }
            return(r);
        }
Ejemplo n.º 3
0
        public static string SaveQualityProduction(string sid, string qtype, string qremark, string rowid)
        {
            string r = "";
            SessionUserValidate iv = SysValidateBll.ValidateSession();

            if (iv.f)
            {
                string             scode   = "";
                string             precode = "";
                B_PartQualityOrder bpqo    = new B_PartQualityOrder();
                B_SaleOrder        bso     = bsob.Query(" and sid='" + sid + "'");
                if (qtype == "s")
                {
                    bpqo.qstate = 1;
                }
                if (qtype == "f")
                {
                    bpqo.qstate = -1;
                    precode     = "F";
                }
                if (bso != null)
                {
                    scode = bso.scode;
                }
                bpqo.cdate  = DateTime.Now.ToString();
                bpqo.maker  = iv.u.ename;
                bpqo.qcode  = scode + "-" + precode + bpqob.QueryQorderNum(" and sid='" + sid + "' and qstate=" + bpqo.qstate + "").ToString();
                bpqo.qsid   = CommonBll.GetSid();
                bpqo.remark = qremark;
                bpqo.sid    = sid;

                List <B_PartQualityItems> lq = new List <B_PartQualityItems>();
                string[] arrow = rowid.ToString().Split(';');
                if (arrow.Length > 0)
                {
                    foreach (string id in arrow)
                    {
                        string             idv   = "";
                        string             etype = "";
                        B_PartQualityItems bpi   = new B_PartQualityItems();
                        if (id.IndexOf('-') > -1)
                        {
                            string [] ids = id.Split('-');
                            idv   = ids[0];
                            etype = ids[1];
                        }
                        else
                        {
                            idv = id;
                        }
                        B_GroupProduction bgp = bgpb.Query(" and id=" + idv + "");
                        if (bgp != null)
                        {
                            bpi.cdate = DateTime.Now.ToString();
                            //if (bgp.ptype == "ms")
                            //{
                            //    B_ProductionItem li = bpib.Query(" and psid='" + bgp.psid + "' and e_ptype='" + etype + "'");
                            //    bpi.deep = li.deep;
                            //    bpi.gnum = bgp.gnum;
                            //    bpi.height = li.height;
                            //    bpi.maker = iv.u.ename;
                            //    bpi.pcode = li.pcode;
                            //    bpi.pname = li.pname;
                            //    bpi.pnum = (int)li.pnum;
                            //    bpi.psid = li.psid;
                            //    bpi.qsid = bpqo.qsid;
                            //    bpi.sid = sid;
                            //    bpi.width = li.width;
                            //    lq.Add(bpi);
                            //}
                            //else
                            //{
                            bpi.deep   = bgp.deep;
                            bpi.gnum   = bgp.gnum;
                            bpi.height = bgp.height;
                            bpi.maker  = iv.u.ename;
                            bpi.pcode  = bgp.icode;
                            bpi.pname  = bgp.iname;
                            bpi.pnum   = (int)bgp.inum;
                            bpi.psid   = bgp.psid;
                            bpi.qsid   = bpqo.qsid;
                            bpi.sid    = sid;
                            bpi.width  = bgp.width;
                            lq.Add(bpi);
                            //}
                        }
                    }
                }
                if (bpqob.SaveQualityOrder(bpqo, lq))
                {
                    List <B_GroupProduction> lbpi = bgpb.QueryList(" and sid='" + sid + "' and substring(icode,9,3)<>'004' and psid not in (select psid from  B_PartQualityItems where qsid in(select qsid from B_PartQualityOrder where sid='" + sid + "' and qstate=1) ) order by gnum");
                    if (lbpi == null)
                    {
                        cosb.UpState(sid, "iquality", 2);
                        cosb.UpState(sid, "ifactorydeliver", 2);
                    }
                    r = "S";
                }
                else
                {
                    r = "F";
                }
            }
            else
            {
                r = iv.badstr;
            }
            return(r);
        }
Ejemplo n.º 4
0
        public void ProcessRequest(HttpContext context)
        {
            ApiReturns     ar   = new ApiReturns();
            PackageMessage pm   = new PackageMessage();
            string         psid = "";
            string         agr  = "";
            int            pid  = 0;

            if (context.Request.QueryString["psid"] != null)
            {
                psid = context.Request.QueryString["psid"].ToString();
            }
            if (context.Request.QueryString["m"] != null)
            {
                agr = context.Request.QueryString["m"].ToString();
            }
            if (psid != "" && agr != "")
            {
                switch (agr)
                {
                case "get":
                    #region    //获取包装
                    pid = Convert.ToInt32(psid.Replace("P", ""));
                    DataRow bp = bpb.ViewQuery(" and bzid='" + pid + "'");
                    if (bp != null)
                    {
                        B_SaleOrder       o  = bsb.Query(" and osid='" + bp["sid"].ToString() + "'");
                        B_AfterSaleOrder  ao = basb.Query(" and sid='" + bp["sid"].ToString() + "'");
                        B_GroupProduction gp = bgpb.Query(" and psid='" + bp["bsid"].ToString() + "'");
                        if (o != null)
                        {
                            pm.city     = o.city;
                            pm.code     = o.scode;
                            pm.customer = o.customer;
                        }
                        if (ao != null)
                        {
                            pm.city     = ao.city;
                            pm.code     = ao.scode;
                            pm.customer = ao.customer;
                        }
                        pm.mname     = gp.mname;
                        pm.pname     = gp.iname;
                        pm.size      = gp.height.ToString() + "*" + gp.width.ToString() + "*" + gp.deep.ToString();
                        pm.direction = gp.direction;
                        pm.osort     = "";// bgpb.QueryPackageGnum(" and psid in (select bsid from View_B_Package where bzid='"+pid+"')");
                        pm.pdate     = bsb.QueryProductDate(bp["sid"].ToString());
                        if (bp != null)
                        {
                            pm.ptype      = bp["btype"].ToString();
                            pm.packnum    = bpb.PackageNum(bp["sid"].ToString()).ToString();
                            pm.curpacknum = bp["bnum"].ToString();
                            if (gp.icode.Substring(0, 2) == "02" || gp.icode.Substring(0, 2) == "06" || gp.icode.Substring(0, 2) == "07")
                            {
                                if (pm.ptype == "门套" || pm.ptype == "套板")
                                {
                                    B_ProductionItem mt     = bpib.Query(" and psid='" + gp.psid + "' and  e_ptype='mt'");
                                    string           mtszie = "";
                                    if (mt != null)
                                    {
                                        mtszie = mt.height.ToString() + "*" + mt.width.ToString() + "*" + mt.deep.ToString();
                                    }
                                    B_ProductionItem lb     = bpib.Query(" and psid='" + gp.psid + "' and  e_ptype='lb'");
                                    string           lbszie = "";
                                    if (lb != null)
                                    {
                                        lbszie = lb.height.ToString() + "*" + lb.width.ToString() + "*" + lb.deep.ToString();
                                    }
                                    if (gp.icode.Substring(0, 2) == "02")
                                    {
                                        if (mtszie != "" && lbszie != "")
                                        {
                                            pm.size2 = mtszie + ";" + lbszie;
                                        }
                                        else
                                        {
                                            pm.size2 = mtszie + lbszie;
                                        }
                                    }
                                }
                                else
                                {
                                    pm.size2 = bp["height"].ToString() + "*" + bp["width"].ToString() + "*" + bp["deep"].ToString();;
                                }
                            }
                            else
                            {
                                if (gp.icode.Substring(0, 2) == "01")
                                {
                                    pm.size2 = bp["height"].ToString() + "*" + bp["width"].ToString() + "*" + bp["deep"].ToString();
                                }
                                else
                                {
                                    pm.size2 = "";
                                }
                            }
                            pm.pcode = "B" + bp["bzid"].ToString();
                            ar.msg   = "S";
                            bpb.UpPackageState(bp["sid"].ToString(), Convert.ToInt32(bp["bnum"].ToString()), "bz", "1");
                            bpdb.UpPackageState(bp["sid"].ToString(), bp["bzid"].ToString(), "bdate");
                            cbsb.UpState(bp["sid"].ToString(), "ipackage", 1);
                            ar.o = pm;
                        }
                        else
                        {
                            ar.msg = "订单不错在";
                        }
                    }
                    else
                    {
                        ar.msg = "产品不错在";
                    }
                    #endregion
                    break;

                case "instore":
                    #region    //包装入库
                    pid = Convert.ToInt32(psid.Replace("B", ""));
                    DataRow zbrk = bpb.ViewQuery(" and bzid=" + pid + "");
                    if (zbrk != null)
                    {
                        if (bpb.UpPackageState(zbrk["sid"].ToString(), Convert.ToInt32(zbrk["bnum"].ToString()), "zbrk", "1"))
                        {
                            #region    //包装入库插入待SAP导入表
                            CB_InSapRecord cisr = new CB_InSapRecord();
                            cisr.sid    = pid.ToString();
                            cisr.stype  = "bzrk";
                            cisr.istate = 0;
                            cisr.cdate  = DateTime.Now.ToString();
                            cisrb.Add(cisr);
                            #endregion
                            bpdb.UpPackageState(zbrk["sid"].ToString(), zbrk["bzid"].ToString(), "insdate");
                            if (bpb.Exists(" and sid='" + zbrk["sid"].ToString() + "' and zbrk=0"))
                            {
                            }
                            else
                            {
                                cbsb.UpState(zbrk["sid"].ToString(), "istoreget", 2);
                                //订单入库销售订单 和销售返修单
                                BaseSet.WorkFlowManage.EventBtnDo.UnUserFireEventBtn(zbrk["sid"].ToString(), "0062", "1", "入库");
                                BaseSet.WorkFlowManage.EventBtnDo.UnUserFireEventBtn(zbrk["sid"].ToString(), "0118", "1", "入库");
                                #region    //订单入库插入待SAP导入表
                                CB_InSapRecord cor = new CB_InSapRecord();
                                cor.sid    = zbrk["sid"].ToString();
                                cor.stype  = "ork";
                                cor.istate = 0;
                                cor.cdate  = DateTime.Now.ToString();
                                cisrb.Add(cor);
                                #endregion
                            }
                            ar.msg = "S";
                        }
                        else
                        {
                            ar.msg = "入库失败";
                        }
                    }
                    else
                    {
                        ar.msg = "包装不错在";
                    }
                    #endregion
                    break;

                case "outstore":
                    #region    //包装出库
                    //pid = Convert.ToInt32(psid.Replace("B", ""));
                    // DataRow zbck = bpb.ViewQuery(" and bzid=" + pid + "");
                    //if (zbck != null)
                    //{
                    //    if (bpb.UpPackageState(zbck["sid"].ToString(), Convert.ToInt32(zbck["bnum"].ToString()), "zbck", "1"))
                    //    {
                    //        bpdb.UpPackageState(zbck["sid"].ToString(), zbck["bzid"].ToString(), "outsdate");
                    //        ar.msg = "S";
                    //    }
                    //    else
                    //    {
                    //        ar.msg = "出库失败";
                    //    }
                    //}
                    //else
                    //{
                    //    ar.msg = "包装不错在";
                    //}
                    #endregion
                    #region    //订单出库
                    B_SaleOrder bso = bsb.Query(" and scode='" + psid + "'");
                    if (bso != null)
                    {
                        bpb.UpPackageState(bso.sid, "zbck", "1");
                        bpdb.UpPackageState(bso.sid, "outsdate");
                        ar.msg = "S";
                        CB_InSapRecord cisr = new CB_InSapRecord();
                        cisr.sid    = bso.sid;
                        cisr.stype  = "ock";
                        cisr.istate = 0;
                        cisr.cdate  = DateTime.Now.ToString();
                        cisrb.Add(cisr);
                    }
                    B_AfterSaleOrder abso = basb.Query(" and scode='" + psid + "'");
                    if (abso != null)
                    {
                        bpb.UpPackageState(abso.sid, "zbck", "1");
                        bpdb.UpPackageState(abso.sid, "outsdate");
                        ar.msg = "S";
                        CB_InSapRecord cisr = new CB_InSapRecord();
                        cisr.sid    = abso.sid;
                        cisr.stype  = "ock";
                        cisr.istate = 0;
                        cisr.cdate  = DateTime.Now.ToString();
                        cisrb.Add(cisr);
                    }


                    #endregion
                    break;

                case "incity":
                    pid = Convert.ToInt32(psid.Replace("B", ""));
                    DataRow csrk = bpb.ViewQuery(" and bzid=" + pid + "");
                    if (csrk != null)
                    {
                        if (bpb.UpPackageState(csrk["sid"].ToString(), Convert.ToInt32(csrk["bnum"].ToString()), "csrk", "1"))
                        {
                            bpdb.UpPackageState(csrk["sid"].ToString(), csrk["bzid"].ToString(), "incdate");
                            ar.msg = "S";
                        }
                        else
                        {
                            ar.msg = "入库失败";
                        }
                    }
                    else
                    {
                        ar.msg = "包装不错在";
                    }
                    break;

                case "outcity":
                    pid = Convert.ToInt32(psid.Replace("B", ""));
                    DataRow csck = bpb.ViewQuery(" and bzid=" + pid + "");
                    if (csck != null)
                    {
                        if (bpb.UpPackageState(csck["sid"].ToString(), Convert.ToInt32(csck["bnum"].ToString()), "csck", "1"))
                        {
                            bpdb.UpPackageState(csck["sid"].ToString(), csck["bzid"].ToString(), "outcdate");
                            ar.msg = "S";
                        }
                        else
                        {
                            ar.msg = "出库失败";
                        }
                    }
                    else
                    {
                        ar.msg = "包装不错在";
                    }
                    break;
                }
            }
            else
            {
                ar.msg = "参数错误";
                ar.o   = null;
            }
            context.Response.Write(js.Serialize(ar));
        }
Ejemplo n.º 5
0
        public static string SaveProductionChangeRequest(string sid, ArrayList prow)
        {
            string r = "";
            SessionUserValidate iv = SysValidateBll.ValidateSession();

            if (iv.f)
            {
                List <B_GroupProductionChangeRequst> lr = new List <B_GroupProductionChangeRequst>();
                if (prow != null)
                {
                    foreach (object[] o in prow)
                    {
                        B_GroupProductionChangeRequst br = new B_GroupProductionChangeRequst();

                        if (o[6].ToString() != "")
                        {
                            int pid = Convert.ToInt32(o[0].ToString());
                            B_GroupProduction bp = bgpb.Query(" and id=" + pid + "");
                            if (bp != null)
                            {
                                br.cdate    = DateTime.Now.ToString();
                                br.crequest = o[6].ToString();
                                br.deep     = bp.deep;
                                br.gnum     = bp.gnum;
                                br.height   = bp.height;
                                br.icode    = bp.icode;
                                br.iname    = bp.iname;
                                br.maker    = iv.u.ename;
                                br.mname    = bp.mname;
                                br.osid     = bp.sid;
                                br.pnum     = bp.inum;
                                br.psid     = bp.psid;
                                br.remark   = bp.ps;
                                br.sid      = sid;
                                br.width    = bp.width;
                                lr.Add(br);
                            }
                        }
                    }
                }
                if (lr.Count > 0)
                {
                    if (bgpcrb.AddList(lr, sid) > 0)
                    {
                        r = "S";
                    }
                    else
                    {
                        r = "F";
                    }
                }
                else
                {
                    r = "F";
                }
            }
            else
            {
                r = iv.badstr;
            }
            return(r);
        }