ch
2022-11-23 695d9c4cda618bae357d6f70a068b604dac4fdd3
WebAPI/Controllers/ÌõÂë¹ÜÀí/WEBSController.cs
@@ -32,10 +32,197 @@
        Pub_Class.ClsXt_SystemParameter oSystemParameter = new Pub_Class.ClsXt_SystemParameter();
        #region åŸºç¡€èµ„æ–™
        #region ä»“库资料
        //根据仓库ID、组织ID,返回仓库信息
        public Model.ClsGy_Warehouse_Model GetWhInfoByIDandOrg(long sHWhID, long HUSEORGID, ref string sErr)
        {
            DAL.ClsIF_Warehouse_View dal = new DAL.ClsIF_Warehouse_View();
            if (dal.GetInfoByIDandOrgID(sHWhID, HUSEORGID))
            {
                return dal.omodel;
            }
            else
            {
                return null;
            }
        }
        #endregion
        #region ä»“位资料
        #endregion
        #endregion
        #region åˆ é™¤æ¡ç å‡ºå…¥åº“临时表记录
        /// <summary>
        /// åˆ é™¤æ¡ç å‡ºå…¥åº“临时表记录
        /// </summary>
        /// <returns></returns>
        [Route("WEBSController/set_DelPonderationBillMain_Temp_InterIDAndSource_Json")]
        [HttpPost]
        public object set_DelPonderationBillMain_Temp_InterIDAndSource_Json(long HInterID, long HMaterID, long HAuxPropID, string HMTONo, long HSourceInterID, long HSourceEntryID, string HBillType)
        {
            try
            {
                if (oWebs.set_DelPonderationBillMain_Temp_InterIDAndSource(HInterID, HMaterID, HAuxPropID, HMTONo, HSourceInterID, HSourceEntryID, HBillType, ref DBUtility.ClsPub.sErrInfo))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 1;
                    objJsonResult.Message = DBUtility.ClsPub.sErrInfo;  //成功!
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                else
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = DBUtility.ClsPub.sErrInfo;  //失败!
                    objJsonResult.data = null;
                    return objJsonResult;
                }
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "删除条码出入库临时表记录失败!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        #region æäº¤ç”Ÿå•处理方法
        #region é”€å”®å‡ºåº“    ä¸Šä¼ ç”Ÿå•
        #region é”€å”®å‡ºåº“    æ ¡éªŒæ¨¡å¼
        /// <summary>
        /// é”€å”®å‡ºåº“校验上传
        /// </summary>
        /// <returns></returns>
        [Route("WEBSController/set_SaveSellOutBill_BillCheck_Json")]
        [HttpPost]
        public object set_SaveSellOutBill_BillCheck_Json([FromBody] JObject oMain)
        {
            var _value = oMain["oMain"].ToString();
            string msg1 = _value.ToString();
            try
            {
                List<Model.ClsKf_SellOutBillMain> lsmain = new List<Model.ClsKf_SellOutBillMain>();
                ListModels oListModels = new ListModels();
                lsmain = oListModels.getSellOutBillMainByJson(msg1);
                WebAPI.WebS.ClsKf_SellOutBillMain websLsmain = new WebS.ClsKf_SellOutBillMain();
                websLsmain.HInterID = lsmain[0].HInterID;
                websLsmain.HBillNo = lsmain[0].HBillNo;
                websLsmain.HBillType = "1205";
                websLsmain.HSTOCKORGID = lsmain[0].HSTOCKORGID;
                if (oWebs.set_SaveSellOutBill_BillCheck(websLsmain, ref DBUtility.ClsPub.sErrInfo))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 1;
                    objJsonResult.Message = DBUtility.ClsPub.sErrInfo;  //成功!
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                else
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = DBUtility.ClsPub.sErrInfo;  //失败!
                    objJsonResult.data = null;
                    return objJsonResult;
                }
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "销售出库校验失败!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        #endregion
        #region ç”Ÿäº§è¡¥æ–™    ä¸Šä¼ ç”Ÿå•
        #region ç”Ÿäº§è¡¥æ–™    æ ¡éªŒæ¨¡å¼
        /// <summary>
        /// ç”Ÿäº§è¡¥æ–™æ ¡éªŒä¸Šä¼ 
        /// </summary>
        /// <returns></returns>
        [Route("WEBSController/set_SaveMateReplenishOutBill_BillCheck_Json")]
        [HttpPost]
        public object set_SaveMateReplenishOutBill_BillCheck_Json([FromBody] JObject oMain)
        {
            var _value = oMain["oMain"].ToString();
            string msg1 = _value.ToString();
            try
            {
                List<Model.ClsKf_MateReplenishOutBillMain> lsmain = new List<Model.ClsKf_MateReplenishOutBillMain>();
                ListModels oListModels = new ListModels();
                lsmain = oListModels.getMateReplenishOutBillMainByJson(msg1);
                WebAPI.WebS.ClsKf_MateReplenishOutBillMain websLsmain = new WebS.ClsKf_MateReplenishOutBillMain();
                websLsmain.HInterID = lsmain[0].HInterID;
                websLsmain.HBillNo = lsmain[0].HBillNo;
                websLsmain.HBillType = "1254";
                websLsmain.HSTOCKORGID = lsmain[0].HSTOCKORGID;
                if (oWebs.set_SaveMateReplenishOutBill_BillCheck(websLsmain, ref DBUtility.ClsPub.sErrInfo))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 1;
                    objJsonResult.Message = DBUtility.ClsPub.sErrInfo;  //成功!
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                else
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = DBUtility.ClsPub.sErrInfo;  //失败!
                    objJsonResult.data = null;
                    return objJsonResult;
                }
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "生产补料校验失败!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        #endregion
        #endregion
@@ -67,7 +254,7 @@
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 1;
                    objJsonResult.Message = DBUtility.ClsPub.sErrInfo;
                    objJsonResult.Message = "成功";
                    objJsonResult.data = WebSoBar;
                    return objJsonResult;
                }
@@ -114,7 +301,7 @@
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 1;
                    objJsonResult.Message = DBUtility.ClsPub.sErrInfo;
                    objJsonResult.Message = "成功";
                    objJsonResult.data = WebSoBar;
                    return objJsonResult;
                }
@@ -179,7 +366,7 @@
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 1;
                    objJsonResult.Message = DBUtility.ClsPub.sErrInfo;
                    objJsonResult.Message = "成功";
                    objJsonResult.data = WebSoBar;
                    return objJsonResult;
                }
@@ -301,13 +488,147 @@
        #endregion
        #region æ ¡éªŒæ¨¡å¼ æ¨¡å—调用方法
        #region ä»Žç¼“存列表编辑功能跳转至单据扫码模块,获取单据信息
        /// <summary>
        /// ä»Žç¼“存列表编辑功能跳转至单据扫码模块,获取单据信息   æ ¡éªŒæ¨¡å¼
        /// </summary>
        /// <returns></returns>
        [Route("WEBSController/GetSourceBillList_BillCheck_Json")]
        [HttpGet]
        public Object GetSourceBillList_BillCheck_Json(string HBillNo, string HBillType)
        {
            try
            {
                WebSoBar = oWebs.GetSourceBillList_BillCheck(HBillNo, HBillType, ref DBUtility.ClsPub.sErrInfo);
                if (WebSoBar == null)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = DBUtility.ClsPub.sErrInfo;
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                else
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "成功";
                    objJsonResult.data = WebSoBar;
                    return objJsonResult;
                }
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "从缓存列表编辑功能跳转至单据扫码模块,获取单据信息失败!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        #region æ‰«æå•据条码  å‡ºå…¥åº“模块
        /// <summary>
        /// æ‰«æå•据条码  å‡ºå…¥åº“模块   æ ¡éªŒæ¨¡å¼
        /// </summary>
        /// <returns></returns>
        [Route("WEBSController/get_BillBarCode_BillCheck_Json")]
        [HttpGet]
        public Object get_BillBarCode_BillCheck_Json(string HBillNo, string HBillType, string HMaker, Int64 HStockOrgID)
        {
            try
            {
                WebSoBar = oWebs.get_BillBarCode_BillCheck(HBillNo, HBillType, HMaker, HStockOrgID, ref DBUtility.ClsPub.sErrInfo);
                if (WebSoBar == null)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = DBUtility.ClsPub.sErrInfo;
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                else
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "成功";
                    objJsonResult.data = WebSoBar;
                    return objJsonResult;
                }
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "扫描单据条码失败!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        #region æ‰«æç‰©æ–™æ¡ç   å‡ºå…¥åº“模块
        /// <summary>
        /// ç‰©æ–™æ¡ç æ–‡æœ¬æ¡† æ ¡éªŒæ‰«ç è°ƒç”¨  æ ¡éªŒæ¨¡å¼
        /// </summary>
        /// <returns></returns>
        [Route("WEBSController/get_CheckTypeByBarCode_BillCheck_Json")]
        [HttpGet]
        public Object get_CheckTypeByBarCode_BillCheck_Json(string sBarCode, Int64 HBillID, string HBillType, string HBillNo, string HMaker, Int64 HWhID, Int64 HSPID, Double HQty, Int64 HStockOrgID)
        {
            try
            {
                WebSoBar = oWebs.get_CheckTypeByBarCode_BillCheck(sBarCode, HBillID, HBillType, HBillNo, HMaker, HWhID, HSPID, HQty, HStockOrgID, ref DBUtility.ClsPub.sErrInfo);
                if (WebSoBar == null)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = DBUtility.ClsPub.sErrInfo;
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                else
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "成功";
                    objJsonResult.data = WebSoBar;
                    return objJsonResult;
                }
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "校验模式,扫描条码失败!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        #region å¤„理方法
        #endregion
        #endregion
        #region å¤„理方法
        #endregion
    }
}