Beispiel #1
0
        public ActionResult GetInvCkBll(String wmsno)
        {
            //检查单号是否存在
            var qrymst = from e in WmsDc.wms_cang_105
                         where e.wmsno == wmsno &&
                         e.times == "2" &&
                         e.bllid == WMSConst.BLL_TYPE_INVENTORY_CHECK
                         select e;
            var arrqrymst = qrymst.ToArray();
            var qrydtl    = from e in WmsDc.wms_cangdtl_105
                            where e.wmsno == wmsno &&
                            e.bllid == WMSConst.BLL_TYPE_INVENTORY_CHECK
                            select e;
            var arrqrydtl = qrydtl.ToArray();

            //单据是否找到
            if (arrqrymst.Length <= 0)
            {
                return(RNoData("N0098"));
            }

            //检查是否有数据权限
            wms_cang_105 mst = arrqrymst[0];

            if (!qus.Contains(mst.qu.Trim()))
            {
                return(RInfo("I0160"));
            }

            return(RSucc("成功", arrqrymst, "S0086"));
        }
Beispiel #2
0
        public ActionResult CancelAdtDtl(String wmsno, String gdsid, int rcdidx)
        {
            //检查单号是否存在
            var qrymst = from e in WmsDc.wms_cang_105
                         where e.wmsno == wmsno &&
                         e.bllid == WMSConst.BLL_TYPE_INVENTORY_CHECK
                         select e;
            var arrqrymst = qrymst.ToArray();
            var qrydtl    = from e in WmsDc.wms_cangdtl_105
                            where e.wmsno == wmsno &&
                            e.gdsid == gdsid && e.rcdidx == rcdidx &&
                            e.bllid == WMSConst.BLL_TYPE_INVENTORY_CHECK
                            select e;
            var arrqrydtl = qrydtl.ToArray();

            //单据是否找到
            if (arrqrymst.Length <= 0)
            {
                return(RNoData("N0106"));
            }
            //检查是否有数据权限
            wms_cang_105 mst = arrqrymst[0];

            ////正在生成拣货单,请稍候重试
            //string quRetrv = mst.qu;
            //if (DoingRetrieve(LoginInfo.DefStoreid, quRetrv))
            //{
            //    return RInfo( "I0161" );
            //}

            /*if (!qus.Contains(mst.qu))
             * {
             *  return RInfo( "I0162" );
             * }*/
            // 判断有无重新复核的权限
            // 检查单号是否已经审核
            if (mst != null && mst.chkflg == GetY())
            {
                return(RInfo("I0163"));
            }
            if (arrqrydtl.Length <= 0)
            {
                return(RNoData("N0107"));
            }
            wms_cangdtl_105 dtl = arrqrydtl[0];

            dtl.bokflg = GetN();
            dtl.bokdat = GetCurrentDate();
            dtl.bkr    = "";
            try
            {
                WmsDc.SubmitChanges();
                return(RSucc("成功", null, "S0092"));
            }
            catch (Exception ex)
            {
                return(RErr(ex.Message, "E0020"));
            }
        }
Beispiel #3
0
        /// <summary>
        /// 通过仓位得到商品明细
        /// </summary>
        /// <param name="boci"></param>
        /// <param name="barcode"></param>
        /// <returns></returns>
        public ActionResult GetDtlByBarcode(string boci, string barcode)
        {
            // 帐表的数据
            //检查单号是否存在
            var qrymst = from e in WmsDc.wms_cang_105
                         where e.lnkbocino == boci &&
                         e.bllid == WMSConst.BLL_TYPE_INVENTORY_CHECK
                         select e;
            wms_cang_105 mst = qrymst.FirstOrDefault();

            object[] dtls = (from e in WmsDc.wms_cangdtl_105
                             join e1 in WmsDc.wms_pkg on e.gdsid equals e1.gdsid
                             join e2 in WmsDc.wms_cang_105 on new { e.wmsno, e.bllid } equals new { e2.wmsno, e2.bllid }
                             join e3 in WmsDc.gds on e.gdsid equals e3.gdsid
                             join e4 in WmsDc.emp on e2.mkr equals e4.empid
                             where e2.lnkbocino == boci &&
                             e2.chkflg == GetN() &&
                             e.barcode == barcode.Trim() &&
                             e.bllid == WMSConst.BLL_TYPE_INVENTORY_CHECK
                             select new
            {
                e2.chkflg,
                e.gdsid,
                e.rcdidx,
                e.tpcode,
                e.barcode,
                e.bcd,
                e.bkr,
                e.bllid,
                e.bokdat,
                e.bokflg,
                e.bthno,
                e.gdstype,
                e.oldbarcode,
                e.pkgid,
                e.pkgqty,
                e.preqty,
                e.qty,
                e.vlddat,
                e.wmsno,
                e3.spc, e3.bsepkg, e3.gdsdes,
                e2.mkr,
                mkrdes = e4.empdes.Trim(),
                e1.cnvrto,
                pkgdes = e1.pkgdes.Trim(),
                pkg03 = GetPkgStr(e.qty, e1.cnvrto, e1.pkgdes),
                pkg03pre = GetPkgStr(e.preqty, e1.cnvrto, e1.pkgdes)
            }).ToArray();
            if (mst == null)
            {
                return(RNoData("N0104"));
            }
            if (dtls.Length == 0)
            {
                return(RNoData("N0105"));
            }

            return(RSucc("成功", dtls, "S0091"));
        }
Beispiel #4
0
        private ActionResult _MakeParam(String wmsno, String oldbarcodes, String gdsids, String gdstypes, String bthnos, String vlddats, String qtys)
        {
            String[] oldbarcode = oldbarcodes.Split(',');
            String[] gdsid      = gdsids.Split(',');
            String[] qty        = qtys.Split(',');
            String[] gdstype    = gdstypes.Split(',');
            String[] bthno      = bthnos.Split(',');
            String[] vlddat     = vlddats.Split(',');
            //String[] newsbarcode = newbarcodes.Split(',');
            List <wms_cangdtl_105> lstDtl = new List <wms_cangdtl_105>();

            if ((oldbarcode.Length != gdsid.Length) &&
                (oldbarcode.Length != qty.Length) &&
                (oldbarcode.Length != gdstype.Length))
            {
                return(RInfo("I0131"));
            }

            //检查盘点抄账单是否有单据
            var qrycz = from e in WmsDc.wms_cang_105
                        where e.bllid == WMSConst.BLL_TYPE_INVENTORY_CHECK &&
                        e.wmsno == wmsno && e.times == "2"
                        select e;
            var arrqrycz = qrycz.ToArray();

            if (arrqrycz.Length <= 0)
            {
                return(RNoData("N0087"));
            }
            //判断盘点是否结束,结束不允许制单
            wms_cang_105 czmst = arrqrycz[0];

            if (czmst.chkflg == GetY())
            {
                return(RInfo("I0132"));
            }
            //盘点传来的参数是否有barcode的权限
            String[] pwdBarcodes = GetBarcodesByBoci(czmst.lnkbocino);
            if (pwdBarcodes == null)
            {
                return(RInfo("I0133"));
            }
            var qryPdcang = from e in oldbarcode
                            where pwdBarcodes.Contains(e.Trim())
                            select e;

            if (qryPdcang.Count() <= 0)
            {
                return(RNoData("N0088"));
            }

            //查询idx最大值
            var qrymx = from e in WmsDc.wms_cangdtl_105
                        where e.bllid == WMSConst.BLL_TYPE_INVENTORY_CHECK &&
                        e.wmsno == wmsno
                        orderby e.rcdidx descending
                        select e;
            var arrqrymx = qrymx.ToArray();
            int i = 0, ii = 0;

            if (arrqrymx.Length > 0)
            {
                i = arrqrymx[0].rcdidx;
            }
            foreach (String s in oldbarcode)
            {
                if (!String.IsNullOrEmpty(s))
                {
                    //判断分区是否有效
                    if (!IsExistBarcode(s))
                    {
                        return(RInfo("I0134", s.Trim()));
                    }
                    wms_cangdtl_105 dtl = new wms_cangdtl_105();
                    dtl.wmsno   = wmsno;
                    dtl.bllid   = WMSConst.BLL_TYPE_INVENTORY_CHECK;
                    dtl.rcdidx  = i + 1;
                    dtl.barcode = s;
                    dtl.gdsid   = gdsid[ii];
                    dtl.gdstype = gdstype[ii];
                    dtl.pkgid   = "01";
                    double fQty = 0;
                    if (!double.TryParse(qty[ii], out fQty))
                    {
                        return(RInfo("I0135", gdsid[i], qty[ii]));
                    }
                    dtl.qty     = Math.Round(fQty, 4, MidpointRounding.AwayFromZero);
                    dtl.preqty  = Math.Round(fQty, 4, MidpointRounding.AwayFromZero);
                    dtl.pkgqty  = Math.Round(fQty, 4, MidpointRounding.AwayFromZero);
                    dtl.gdstype = gdstype[ii];
                    dtl.bthno   = string.IsNullOrEmpty(bthno[ii]) ? "1" : bthno[ii];
                    dtl.vlddat  = string.IsNullOrEmpty(vlddat[ii]) ? GetCurrentDay() : vlddat[ii];
                    if (gdsid[ii] != "1")
                    {
                        JsonResult    jr = (JsonResult)GetBcdByGdsid(gdsid[ii]);
                        ResultMessage rm = (ResultMessage)jr.Data;
                        if (rm.ResultCode != ResultMessage.RESULTMESSAGE_SUCCESS)
                        {
                            return(RInfo("I0136", gdsid[ii]));
                        }
                        bcd[] b = (bcd[])rm.ResultObject;
                        dtl.bcd = b[0].bcd1;
                    }
                    else
                    {
                        dtl.bcd = "";
                    }
                    dtl.bkr    = "";
                    dtl.bokflg = GetN();
                    dtl.bokdat = GetCurrentDate();

                    lstDtl.Add(dtl);
                    i++;
                    ii++;
                }
            }

            return(RSucc("成功", lstDtl.ToArray(), "S0077"));
        }
Beispiel #5
0
        public ActionResult GetInvCkBllDtl(String wmsno)
        {
            //检查单号是否存在
            var qrymst = from e in WmsDc.wms_cang_105
                         where e.wmsno == wmsno &&
                         e.bllid == WMSConst.BLL_TYPE_INVENTORY_CHECK
                         select e;
            var arrqrymst = qrymst.ToArray();
            var qrydtl    = from e in WmsDc.wms_cangdtl_105
                            join e1 in WmsDc.gds on e.gdsid equals e1.gdsid
                            into joinGds from e2 in joinGds.DefaultIfEmpty()
                            join e3 in WmsDc.wms_pkg on new { e2.gdsid } equals new { e3.gdsid }
            into joinPkg from e4 in joinPkg.DefaultIfEmpty()
            where e.wmsno == wmsno &&
            e.bllid == WMSConst.BLL_TYPE_INVENTORY_CHECK
                select new
            {
                e.barcode,
                e.bcd,
                e.bkr,
                e.bllid,
                e.bokdat,
                e.bokflg,
                e.bthno,
                e.gdsid,
                e.gdstype,
                e.oldbarcode,
                e.pkgid,
                e.pkgqty,
                e.preqty,
                e.qty,
                e.rcdidx,
                e.tpcode,
                e.vlddat,
                e.wmsno,
                e2.spc,
                e2.gdsdes,
                e2.bsepkg,
                cnvrto   = e4.cnvrto == null ? 0 : e4.cnvrto,
                pkgdes   = e4.pkgdes.Trim(),
                pkg03    = GetPkgStr(e.qty, e4.cnvrto, e4.pkgdes),
                pkg03pre = GetPkgStr(e.preqty, e4.cnvrto, e4.pkgdes)
            };
            var arrqrydtl = qrydtl.ToArray();

            //单据是否找到
            if (arrqrymst.Length <= 0)
            {
                return(RNoData("N0096"));
            }
            //单据是否找到
            if (arrqrydtl.Length <= 0)
            {
                return(RNoData("N0097"));
            }
            //检查是否有数据权限
            wms_cang_105 mst = arrqrymst[0];

            if (!qus.Contains(mst.qu.Trim()))
            {
                return(RInfo("I0159"));
            }

            return(RSucc("成功", arrqrydtl, "S0085"));
        }
Beispiel #6
0
        public ActionResult InstInvCkBll(String wmsno, String barcodes, String gdsids, String gdstypes, String bthnos, String vlddats, String qtys)
        {
            //拆分参数
            //检查并创建明细
            JsonResult    jr = (JsonResult)_MakeParam(wmsno, barcodes, gdsids, gdstypes, bthnos, vlddats, qtys);
            ResultMessage rm = (ResultMessage)jr.Data;

            if (rm.ResultCode != ResultMessage.RESULTMESSAGE_SUCCESS)
            {
                return(jr);
            }

            //检查单号是否存在
            var qrymst = from e in WmsDc.wms_cang_105
                         where e.wmsno == wmsno &&
                         e.bllid == WMSConst.BLL_TYPE_INVENTORY_CHECK &&
                         e.times == "2"
                         select e;
            var arrqrymst = qrymst.ToArray();
            var qrydtl    = from e in WmsDc.wms_cangdtl_105
                            where e.wmsno == wmsno &&
                            e.bllid == WMSConst.BLL_TYPE_INVENTORY_CHECK
                            select e;
            var arrqrydtl = qrydtl.ToArray();

            //单据是否找到
            if (arrqrymst.Length <= 0)
            {
                return(RNoData("N0095"));
            }
            //检查是否有数据权限
            wms_cang_105 mst = arrqrymst[0];

            ////正在生成拣货单,请稍候重试
            //string quRetrv = mst.qu;
            //if (DoingRetrieve(LoginInfo.DefStoreid, quRetrv))
            //{
            //    return RInfo( "I0152" );
            //}


            if (!qus.Contains(mst.qu.Trim()))
            {
                return(RInfo("I0153"));
            }
            //检查单号是否已经审核
            if (mst != null && mst.chkflg == GetY())
            {
                return(RInfo("I0154"));
            }
            //删除单据明细
            //WmsDc.wms_cangdtl_105.DeleteAllOnSubmit(arrqrydtl);

            //增加单据明细
            wms_cangdtl_105[] newdtl = (wms_cangdtl_105[])rm.ResultObject;

            //判断newdtl里面有没有重复录入的数据
            var qrygrp    = newdtl.GroupBy(e => new { e.barcode, e.gdsid, e.gdstype }).Where(e => e.Count() > 1);
            var arrqrygrp = qrygrp.Select(e => e.Key).ToArray();

            if (arrqrygrp.Length > 0)
            {
                var g = arrqrygrp[0];
                return(RInfo("I0155", g.gdsid, g.gdstype));
            }

            //检查是否已经盘过点了
            foreach (wms_cangdtl_105 d in newdtl)
            {
                //判断是否该商品是否在该区
                if (!dtqus.Contains(mst.qu) && d.gdsid.Trim() != "1")
                {
                    var hasPwrInQu = (from e in WmsDc.wms_set
                                      join e1 in WmsDc.gds on e.val2 equals e1.dptid
                                      where e.setid == "001" && e.val3 == mst.savdptid &&
                                      e1.gdsid == d.gdsid.Trim() && e.val1 == GetQuByBarcode(d.barcode.Trim())
                                      select e.val1.Trim()).FirstOrDefault();
                    if (hasPwrInQu == null || hasPwrInQu != mst.qu)
                    {
                        return(RInfo("I0488"));
                    }
                }

                String boci = GetBociByWmsno(d.wmsno);
                d.oldbarcode = boci;
                if (HasChecked(d))
                {
                    return(RInfo("I0156", d.gdsid, d.gdstype));
                }
                d.oldbarcode = "";
            }

            WmsDc.wms_cangdtl_105.InsertAllOnSubmit(newdtl);
            try
            {
                WmsDc.SubmitChanges();
                return(RSucc("成功", newdtl, "S0083"));
            }
            catch (Exception ex)
            {
                return(RErr(ex.Message, "E0019"));
            }
        }
Beispiel #7
0
        public ActionResult DlInvCkBll(String wmsno)
        {
            //检查单号是否存在
            var qrymst = from e in WmsDc.wms_cang_105
                         where e.wmsno == wmsno &&
                         e.bllid == WMSConst.BLL_TYPE_INVENTORY_CHECK
                         select e;
            var arrqrymst = qrymst.ToArray();
            var qrydtl    = from e in WmsDc.wms_cangdtl_105
                            where e.wmsno == wmsno &&
                            e.bllid == WMSConst.BLL_TYPE_INVENTORY_CHECK
                            select e;
            var arrqrydtl = qrydtl.ToArray();

            //单据是否找到
            if (arrqrymst.Length <= 0)
            {
                return(RNoData("N0094"));
            }
            //检查是否有数据权限
            wms_cang_105 mst = arrqrymst[0];

            ////正在生成拣货单,请稍候重试
            //string quRetrv = mst.qu;
            //if (DoingRetrieve(LoginInfo.DefStoreid, quRetrv))
            //{
            //    return RInfo( "I0148" );
            //}

            if (!qus.Contains(mst.qu.Trim()))
            {
                return(RInfo("I0149"));
            }
            //检查单号是否已经审核
            if (mst != null && mst.chkflg == GetY())
            {
                return(RInfo("I0150"));
            }
            //检查明细是否有审核的
            foreach (wms_cangdtl_105 d in arrqrydtl)
            {
                if (d.bokflg == GetY())
                {
                    return(RInfo("I0151"));
                }
            }
            //删除单据明细
            WmsDc.wms_cangdtl_105.DeleteAllOnSubmit(arrqrydtl);
            WmsDc.wms_cang_105.DeleteAllOnSubmit(arrqrymst);
            iDelCangDtl105(arrqrydtl, mst);
            iDelCangMst105(mst);
            //删除主单据
            try
            {
                WmsDc.SubmitChanges();

                return(RSucc("成功", null, "S0082"));
            }
            catch (Exception ex)
            {
                return(RErr(ex.Message, "E0018"));
            }
        }
Beispiel #8
0
        /// <summary>
        /// 盘点单明细修改
        /// </summary>
        /// <param name="wmsno"></param>
        /// <param name="gdsid"></param>
        /// <param name="rcdidx"></param>
        /// <param name="qty"></param>
        /// <returns></returns>
        public ActionResult MdInvCkBllDtl(String wmsno, String gdsid, int rcdidx, double qty)
        {
            //检查单号是否存在
            var qrymst = from e in WmsDc.wms_cang_105
                         where e.wmsno == wmsno &&
                         e.bllid == WMSConst.BLL_TYPE_INVENTORY_CHECK
                         select e;
            var arrqrymst = qrymst.ToArray();
            var qrydtl    = from e in WmsDc.wms_cangdtl_105
                            where e.wmsno == wmsno &&
                            e.gdsid == gdsid && e.rcdidx == rcdidx &&
                            e.bllid == WMSConst.BLL_TYPE_INVENTORY_CHECK
                            select e;
            var arrqrydtl = qrydtl.ToArray();

            //单据是否找到
            if (arrqrymst.Length <= 0)
            {
                return(RNoData("N0092"));
            }
            //检查是否有数据权限
            wms_cang_105 mst = arrqrymst[0];



            ////正在生成拣货单,请稍候重试
            //string quRetrv = mst.qu;
            //if (DoingRetrieve(LoginInfo.DefStoreid, quRetrv))
            //{
            //    return RInfo( "I0144" );
            //}

            if (!qus.Contains(mst.qu.Trim()))
            {
                return(RInfo("I0145"));
            }
            //检查单号是否已经审核
            if (mst != null && mst.chkflg == GetY())
            {
                return(RInfo("I0146"));
            }
            if (arrqrydtl.Length <= 0)
            {
                return(RNoData("N0093"));
            }
            wms_cangdtl_105 dtl = arrqrydtl[0];

            //明细如果已经确认就不能修改明细了
            if (dtl.bokflg == GetY())
            {
                return(RInfo("I0147"));
            }
            dtl.qty    = Math.Round(qty, 4, MidpointRounding.AwayFromZero);
            dtl.pkgqty = dtl.qty;
            dtl.preqty = dtl.qty;
            try
            {
                WmsDc.SubmitChanges();
                return(RSucc("成功", null, "S0081"));
            }
            catch (Exception ex)
            {
                return(RErr(ex.Message, "E0017"));
            }
        }
Beispiel #9
0
        public ActionResult DlInvCkBllDtl(String wmsno, String gdsid, int rcdidx)
        {
            //检查单号是否存在
            var qrymst = from e in WmsDc.wms_cang_105
                         where e.wmsno == wmsno &&
                         e.bllid == WMSConst.BLL_TYPE_INVENTORY_CHECK
                         select e;
            var arrqrymst = qrymst.ToArray();
            var qrydtl    = from e in WmsDc.wms_cangdtl_105
                            where e.wmsno == wmsno &&
                            e.bllid == WMSConst.BLL_TYPE_INVENTORY_CHECK
                            select e;
            var arrqrydtl  = qrydtl.ToArray();
            var arrqrydtl1 = qrydtl.Where(e => e.gdsid == gdsid && e.rcdidx == rcdidx).ToArray();

            //单据是否找到
            if (arrqrymst.Length <= 0)
            {
                return(RNoData("N0090"));
            }
            //检查是否有数据权限
            wms_cang_105 mst = arrqrymst[0];

            ////正在生成拣货单,请稍候重试
            //string quRetrv = mst.qu;
            //if (DoingRetrieve(LoginInfo.DefStoreid, quRetrv))
            //{
            //    return RInfo( "I0140" );
            //}
            if (!qus.Contains(mst.qu.Trim()))
            {
                return(RInfo("I0141"));
            }
            //检查单号是否已经审核
            if (mst != null && mst.chkflg == GetY())
            {
                return(RInfo("I0142"));
            }
            //检查是否查询到明细数据
            if (arrqrydtl1.Length <= 0)
            {
                return(RNoData("N0091"));
            }
            //检查明细是否有审核的
            if (arrqrydtl1[0].bokflg == GetY())
            {
                return(RInfo("I0143"));
            }
            //删除单据明细
            int iDtlCnt = arrqrydtl.Length;

            WmsDc.wms_cangdtl_105.DeleteAllOnSubmit(arrqrydtl1);
            iDelCangDtl105(arrqrydtl1, arrqrymst[0]);
            if (iDtlCnt == 1)
            {
                WmsDc.wms_cang_105.DeleteAllOnSubmit(arrqrymst);
                iDelCangMst105(arrqrymst[0]);
            }
            //删除主单据
            try
            {
                WmsDc.SubmitChanges();
                return(RSucc("成功", null, "S0080"));
            }
            catch (Exception ex)
            {
                return(RErr(ex.Message, "E0016"));
            }
        }
Beispiel #10
0
        public ActionResult MkInvCkBll(String boci, String qu)
        {
            String savdptid = GetSavdptidByQu(qu);

            ////正在生成拣货单,请稍候重试
            //string quRetrv = qu;
            //if (DoingRetrieve(LoginInfo.DefStoreid, quRetrv))
            //{
            //    return RInfo( "I0137" );
            //}

            //盘点区在不在设置区内
            if (!IsInSetQu(boci, qu))
            {
                return(RInfo("I0138"));
            }

            return(MakeNewBllNo(savdptid, qu, WMSConst.BLL_TYPE_INVENTORY_CHECK, (bllno) =>
            {
                //检查并创建明细

                /*JsonResult jr = (JsonResult)_MakeParam(bllno, barcodes, gdsids, gdstypes, qtys);
                 * ResultMessage rm = (ResultMessage)jr.Data;
                 * if (rm.ResultCode != ResultMessage.RESULTMESSAGE_SUCCESS)
                 * {
                 *  return rm;
                 * }
                 * wms_cangdtl_105[] dtls = (wms_cangdtl_105[])rm.ResultObject;*/

                ResultMessage rm = new ResultMessage();
                wms_cang_105 mst = new wms_cang_105();
                //创建主表
                mst.wmsno = bllno;
                mst.bllid = WMSConst.BLL_TYPE_INVENTORY_CHECK;
                mst.savdptid = savdptid;
                mst.prvid = "";
                //String qu = GetQuByGdsid(dtls[0].gdsid, LoginInfo.DefSavdptid);
                mst.qu = qu;
                mst.rcvdptid = "";
                mst.times = "2";
                mst.lnkbocino = boci;
                mst.lnkbocidat = "";
                mst.mkr = LoginInfo.Usrid;
                mst.mkedat = GetCurrentDay();
                mst.mkedat2 = GetCurrentDate();
                mst.ckr = "";
                mst.chkflg = GetN();
                mst.chkdat = "";
                mst.opr = LoginInfo.Usrid;
                mst.brief = "";
                mst.lnkbllid = "";
                mst.lnkno = "";
                mst.lnkbrief = "";

                if (HasCkBll(boci, qu, LoginInfo.Usrid))
                {
                    return RRInfo("I0440", boci, qu);
                }

                WmsDc.wms_cang_105.InsertOnSubmit(mst);
                //WmsDc.wms_cangdtl_105.InsertAllOnSubmit(dtls);

                try
                {
                    WmsDc.SubmitChanges();
                    return RRSucc("成功", mst, "S0216");
                }
                catch (Exception ex)
                {
                    return RRErr(ex.Message, "E0063");
                }
            }));
        }
Beispiel #11
0
        public ActionResult AdtInvChk(String wmsno)
        {
            //检查单号是否存在
            var qrymst = from e in WmsDc.wms_cang_105
                         where e.wmsno == wmsno &&
                         e.bllid == WMSConst.BLL_TYPE_INVENTORY_CHECK
                         select e;
            var arrqrymst = qrymst.ToArray();
            var qrydtl    = from e in WmsDc.wms_cangdtl_105
                            where e.wmsno == wmsno &&
                            e.bllid == WMSConst.BLL_TYPE_INVENTORY_CHECK
                            select e;
            var arrqrydtl = qrydtl.ToArray();

            //单据是否找到
            if (arrqrymst.Length <= 0)
            {
                return(RNoData("N0110"));
            }
            //检查是否有数据权限
            wms_cang_105 mst = arrqrymst[0];

            ////正在生成拣货单,请稍候重试
            //string quRetrv = mst.qu;
            //if (DoingRetrieve(LoginInfo.DefStoreid, quRetrv))
            //{
            //    return RInfo( "I0168" );
            //}

            /*if (!qus.Contains(mst.qu))
             * {
             *  return RInfo( "I0169" );
             * }*/
            //检查单号是否已经审核
            if (mst != null && mst.chkflg == GetY())
            {
                return(RInfo("I0170"));
            }
            if (arrqrydtl.Length <= 0)
            {
                return(RNoData("N0111"));
            }

            //检查明细是否已经审核完毕
            foreach (wms_cangdtl_105 d in arrqrydtl)
            {
                if (d.bokflg != GetY() && d.gdsid.Trim() != "1")
                {
                    return(RInfo("I0171"));
                }
            }

            //审核主单
            mst.chkflg = GetY();
            mst.chkdat = GetCurrentDay();
            mst.ckr    = LoginInfo.Usrid;

            try
            {
                WmsDc.SubmitChanges();
                return(RSucc("成功", null, "S0094"));
            }
            catch (Exception ex)
            {
                return(RErr(ex.Message, "E0022"));
            }
        }
Beispiel #12
0
        public ActionResult AdtInvChkDtl(String wmsno, String gdsid, int rcdidx, double?qty)
        {
            //检查单号是否存在
            var qrymst = from e in WmsDc.wms_cang_105
                         where e.wmsno == wmsno &&
                         e.bllid == WMSConst.BLL_TYPE_INVENTORY_CHECK
                         select e;
            var arrqrymst = qrymst.ToArray();
            var qrydtl    = from e in WmsDc.wms_cangdtl_105
                            where e.wmsno == wmsno &&
                            e.gdsid == gdsid && e.rcdidx == rcdidx &&
                            e.bllid == WMSConst.BLL_TYPE_INVENTORY_CHECK
                            select e;
            var arrqrydtl = qrydtl.ToArray();

            //单据是否找到
            if (arrqrymst.Length <= 0)
            {
                return(RNoData("N0108"));
            }
            //检查是否有数据权限
            wms_cang_105 mst = arrqrymst[0];

            ////正在生成拣货单,请稍候重试
            //string quRetrv = mst.qu;
            //if (DoingRetrieve(LoginInfo.DefStoreid, quRetrv))
            //{
            //    return RInfo( "I0164" );
            //}

            /*if (!qus.Contains(mst.qu))
             * {
             *  return RInfo( "I0165" );
             * }*/
            // 判断有无重新复核的权限
            // 检查单号是否已经审核
            if (mst.chkflg == GetY())
            {
                return(RInfo("I0166"));
            }
            if (arrqrydtl.Length <= 0)
            {
                return(RNoData("N0109"));
            }
            wms_cangdtl_105 dtl = arrqrydtl[0];

            if (dtl.bokflg == GetY())
            {
                return(RInfo("I0167"));
            }
            dtl.bokflg = GetY();
            dtl.bokdat = GetCurrentDay();
            dtl.bkr    = LoginInfo.Usrid;
            if (qty != null)
            {
                dtl.qty    = qty.Value;
                dtl.pkgqty = qty.Value;
                dtl.preqty = qty.Value;
            }
            try
            {
                WmsDc.SubmitChanges();
                return(RSucc("成功", null, "S0093"));
            }
            catch (Exception ex)
            {
                return(RErr(ex.Message, "E0021"));
            }
        }