1
zrg
2024-11-06 fa997057189d83a4dacb629c7e898d4b5a4d867f
WebAPI/Controllers/SellOutController.cs
@@ -64,6 +64,127 @@
        }
        /// <summary>
        /// 销售出库缓存列表编辑按钮 获取表体信息
        /// </summary>
        /// <param name="HSourceBillNo"></param>
        /// <returns></returns>
        [Route("SellOut/SellOutDetaiNew")]
        [HttpGet]
        public object SellOutDetaiNew(string HInterID)
        {
            DataSet ds;
            List<object> list = new List<object>();
            string Swhere = "";
            try
            {
                if (HInterID != "" || HInterID != null)
                {
                    Swhere = " and hmainid='" + HInterID + "'";
                }
                else
                {
                    Swhere = HInterID;
                }
                SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
                //获取销售出库编辑数据
                string sql = "select  数量 HQty,应收数量 HQtyMust,物料代码 HMaterNumber,物料名称 HMaterName,规格型号 HMaterModel,源单主内码 HSourceInterID,源单子内码 HSourceEntryID,源单单号 HSourceBillNo,批次 HBatchNo,辅助属性 HAuxPropID,计划跟踪号 HMTONo,ck HWHID  from h_v_SelloutDetail where 1 = 1 " + Swhere + "";
                ds = oCN.RunProcReturn(sql, "h_v_SelloutDetail");
                list.Add(ds.Tables[0]);
                objJsonResult.code = "0";
                objJsonResult.count = 1;
                objJsonResult.Message = "获取信息成功!";
                objJsonResult.list = list;
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "没有返回任何记录!" + e.ToString();
                objJsonResult.data = null;
            }
            return objJsonResult;
        }
        //已上传列表刷新
        [Route("Web/DisBillUpdateLoad_Json")]
        [HttpGet]
        public object DisBillUpdateLoad_Json(string HBillType, string HMaker, Int64 HOrgID)
        {
            try
            {
                ds = webserver.GetDisBillUpdateLoad_Json(HBillType, HMaker, HOrgID);
                if (ds == null || ds.Tables[0].Rows.Count <= 0)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "没有返回任何记录!";
                    objJsonResult.data = null;
                    return objJsonResult;
                    //DBUtility.ClsPub.MessageBeep((int)DBUtility.ClsPub.BeepType.Warning);
                }
                else
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "获取信息成功!";
                    objJsonResult.data = ds.Tables[0];
                    return objJsonResult;
                }
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "没有返回任何记录!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        //已上传查询
        [Route("Web/QueryBillUpdateLoad_Json")]
        [HttpGet]
        public object QueryBillUpdateLoad_Json(string BillType, string HBillNo, string HSourceBillNo)
        {
            try
            {
                ds = webserver.GetQueryBillUpdateLoad_Json(BillType, HBillNo, HSourceBillNo);
                if (ds == null || ds.Tables[0].Rows.Count <= 0)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "没有返回任何记录!";
                    objJsonResult.data = null;
                    return objJsonResult;
                    //DBUtility.ClsPub.MessageBeep((int)DBUtility.ClsPub.BeepType.Warning);
                }
                else
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "获取信息成功!";
                    objJsonResult.data = ds.Tables[0];
                    return objJsonResult;
                }
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "没有返回任何记录!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        [Route("SellOut/GetMAXNum")]
        [HttpGet]
        public object GetMAXNum()
@@ -185,8 +306,10 @@
        {
            try
            {
               // DataSet ds = new DataSet();
               // WebServer webserver = new WebServer();
                //同步销售订单
                new SQLHelper.ClsCN().RunProcReturn("EXEC h_p_IFCLD_ERPSourceBillToLocal_SEOrder '" + HSourceBillNo + "'", "h_p_IFCLD_ERPSourceBillToLocal_SEOrder");
                // DataSet ds = new DataSet();
                // WebServer webserver = new WebServer();
                string sWhere = " Where 单据号 like '%" + HSourceBillNo.Trim() + "%'";
                //
                if (HSourceBillType == "1402")
@@ -254,11 +377,11 @@
        //销售出库/扫条码/直接调webservice
        [Route("SellOut/get_CheckTypeByBarCode_Json")]
        [HttpGet]
        public Object get_CheckTypeByBarCode_Json(string sCode, Int64 sInterID,string HBillType, string sBillNo, string sMaker, Int64 WhID, Int64 SPID, Double sQty, bool sRedBlue, bool SourceFlag, string sSourceBillNo, string sSourceType, Int64 HOWNERID)
        public Object get_CheckTypeByBarCode_Json(string sCode, Int64 sInterID, string HBillType, string sBillNo, string sMaker, Int64 WhID, Int64 SPID, Double sQty, bool sRedBlue, bool SourceFlag, string sSourceBillNo, string sSourceType, Int64 HOWNERID, string HScanStyle)
        {
            //oBar = webserver.get_CheckTypeByBarCode(sCode, sInterID, HBillType, sBillNo, sMaker, WhID, SPID, sQty, sRedBlue, SourceFlag, sSourceBillNo, sSourceType, HOWNERID, ref DBUtility.ClsPub.sErrInfo);
            string sExpressNumber = "";
            WebSoBar = oWebs.get_CheckTypeByBarCode_All(sCode, sInterID, HBillType, sBillNo, sMaker, WhID, SPID, sQty, sRedBlue, SourceFlag, sSourceBillNo, sSourceType, HOWNERID, sExpressNumber, ref DBUtility.ClsPub.sErrInfo);
            WebSoBar = oWebs.get_CheckTypeByBarCode_New(sCode, sInterID, HBillType, sBillNo, sMaker, WhID, SPID, sQty, sRedBlue, SourceFlag, sSourceBillNo, sSourceType, HOWNERID, sExpressNumber, HScanStyle, ref DBUtility.ClsPub.sErrInfo);
            if (WebSoBar == null)
            {
                objJsonResult.code = "0";
@@ -272,10 +395,37 @@
                objJsonResult.code = "0";
                objJsonResult.count = 1;
                objJsonResult.Message = DBUtility.ClsPub.sErrInfo;
                objJsonResult.data = oBar;
                objJsonResult.data = WebSoBar;
                return objJsonResult;
            }
        }
        //public object get_CheckTypeByBarCode_Json(string sCode, long sInterID, string HBillType, string sBillNo, string sMaker, long WhID, long SPID, double sQty, bool sRedBlue, bool SourceFlag, string sSourceBillNo, string sSourceType, long HOWNERID)
        //{
        //    string hexpressNumber = "";
        //    this.WebSoBar = this.oWebs.get_CheckTypeByBarCode_All(sCode, sInterID, HBillType, sBillNo, sMaker, WhID, SPID, sQty, sRedBlue, SourceFlag, sSourceBillNo, sSourceType, HOWNERID, hexpressNumber, ref ClsPub.sErrInfo);
        //    bool flag = this.WebSoBar == null;
        //    object result;
        //    if (flag)
        //    {
        //        this.objJsonResult.code = "0";
        //        this.objJsonResult.count = 0;
        //        this.objJsonResult.Message = ClsPub.sErrInfo;
        //        this.objJsonResult.data = null;
        //        result = this.objJsonResult;
        //    }
        //    else
        //    {
        //        this.objJsonResult.code = "0";
        //        this.objJsonResult.count = 1;
        //        this.objJsonResult.Message = ClsPub.sErrInfo;
        //        this.objJsonResult.data = this.oBar;
        //        result = this.objJsonResult;
        //    }
        //    return result;
        //}
        /// <summary>
        /// 返回出入库条码临时表     
        /// </summary>
@@ -434,8 +584,8 @@
                List<Model.ClsKf_SellOutBillMain> lsmain = new List<Model.ClsKf_SellOutBillMain>();
                ListModels oListModels = new ListModels();
                lsmain = oListModels.getSellOutBillMainByJson(msg1);
                lsmain[0].HYear = DBUtility.ClsPub.isLong(DateTime.Now.Year);
                lsmain[0].HDate = DBUtility.ClsPub.isDate(DateTime.Now.ToString("yyyy-MM-dd"));
                //lsmain[0].HYear = DBUtility.ClsPub.isLong(DateTime.Now.Year);
                //lsmain[0].HDate = DBUtility.ClsPub.isDate(DateTime.Now.ToString("yyyy-MM-dd"));
                lsmain[0].HRedBlueFlag = false;
                string sSourceBillType = lsmain[0].HBillType;
@@ -448,12 +598,14 @@
                websLsmain.HEmpID = lsmain[0].HEmpID;
                websLsmain.HRemark = lsmain[0].HRemark;
                websLsmain.HMaker = lsmain[0].HMaker;
                websLsmain.HKeeperID= lsmain[0].HKeeperID;
                websLsmain.HBillType = "1205";//固定值
                if (webserver.set_SaveSellOutBill_New(websLsmain, sSourceBillType, ref DBUtility.ClsPub.sErrInfo))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "生成销售出库单成功!单据号为:";
                    objJsonResult.Message = DBUtility.ClsPub.sErrInfo;  //成功!
                    objJsonResult.data = null;
                    return objJsonResult;
                }
@@ -461,7 +613,8 @@
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "上传失败!" + DBUtility.ClsPub.sErrInfo;
                    objJsonResult.Message = DBUtility.ClsPub.sErrInfo;  //失败!
                    //objJsonResult.Message = "上传失败!" + DBUtility.ClsPub.sErrInfo;
                    objJsonResult.data = null;
                    return objJsonResult;
                }