zgq
2021-08-11 15cd183e1954f46567f2cfc62eccd31672fa5e7f
WebAPI/Controllers/WebAPIController.cs
@@ -289,6 +289,135 @@
            }
        }
        /// <summary>
        /// 获取扫码详情列表
        /// </summary>
        /// <returns></returns>
        [Route("Web/GetWMSBarCodeDetailsList")]
        [HttpGet]
        public object GetWMSBarCodeDetailsList(int HInterID, string HBillType, int HMaterID, int HAuxPropID, string HMTONo, string HBatchNo, int HSourceInterID, int HSourceEntryID, string sWhere)
        {
            try
            {
                SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
                //ds = oCN.RunProcReturn("Select * from h_v_KF_PonderationBillMain_Temp_Sum where HInterID=" + HInterID + " and HBillType='" + HBillType + "' Order by HItemID ", "h_v_KF_PonderationBillMain_Temp_Sum");
                ds = oCN.RunProcReturn("Select HMTONo,HBatchNo,HBarCode,HWHID,HStockPlaceID,HSCWHID,HOutStockPlaceID,sum(HQty) HQty from KF_PonderationBillMain_Temp Where HQty<>0 and HInterID=" + HInterID.ToString() +
                            " and HBillType='" + HBillType + "'" +
                            " and HMaterID=" + HMaterID +
                            " and HAuxPropID=" + HAuxPropID +
                            " and HMTONo='" + HMTONo + "'" +
                            //" and HWHID=" + HWhID +
                            //" and HStockPlaceID=" + HSPID +
                            //" and HSCWHID=" + HSCWhID +
                            //" and HOutStockPlaceID=" + HSCSPID +
                            " and (HBatchNo='" + HBatchNo + "' or '" + HBatchNo + "' ='')" +
                            " and HSourceInterID=" + HSourceInterID +
                            " and HSourceEntryID=" + HSourceEntryID +
                             sWhere +
                            " Group by HBatchNo,HMTONo,HBarCode,HWHID,HStockPlaceID,HSCWHID,HOutStockPlaceID", "KF_PonderationBillMain_Temp", ref DBUtility.ClsPub.sExeReturnInfo);
                if (ds == null || ds.Tables[0].Rows.Count <= 0)
                {
                    objjson.code = "0";
                    objjson.count = 0;
                    objjson.Message = "获取失败" + DBUtility.ClsPub.sErrInfo;
                    objjson.data = null;
                    return objjson;
                }
                else
                {
                    objjson.code = "0";
                    objjson.count = 1;
                    objjson.Message = "获取成功!";
                    objjson.data = ds.Tables[0];
                    return objjson;
                }
            }
            catch (Exception ex)
            {
                objjson.code = "0";
                objjson.count = 0;
                objjson.Message = "获取失败" + ex.ToString();
                objjson.data = null;
                return objjson;
            }
        }
        /// <summary>
        /// 扫码详情中删除缓存表中扫码记录
        /// </summary>
        /// <param name="HInterID"></param>
        /// <param name="HMaterID">物料ID</param>
        /// <param name="HAuxPropID">辅助属性ID</param>
        /// <param name="HMTONo"></param>
        /// <param name="HBillType">单据类型</param>
        /// <param name="HSourceInterID">源单主ID</param>
        /// <param name="HSourceEntryID">源单子ID</param>
        /// <returns>object</returns>
        [Route("Web/DelCacheList")]
        [HttpGet]
        public object DelCacheList(int HInterID, int HMaterID, int HAuxPropID, string HMTONo, string HBillType, int HSourceInterID, int HSourceEntryID)
        {
            try
            {
                SQLHelper.ClsCN oCn = new SQLHelper.ClsCN();
                //oCn.RunProc("Delete from KF_PonderationBillMain_Temp where HitemID = " + sHitemID);
                oCn.RunProc("Delete from KF_PonderationBillMain_Temp where HInterID=" + HInterID.ToString() + " and HMaterID= " + HMaterID.ToString() + " and HAuxPropID= " + HAuxPropID.ToString() + " and HMTONo='" + HMTONo + "' and HBillType='" + HBillType + "' and HSourceInterID=" + HSourceInterID.ToString() + " and HSourceEntryID=" + HSourceEntryID.ToString() + " and HQty<>0 ", ref DBUtility.ClsPub.sExeReturnInfo);
                objJsonResult.code = "1";
                objJsonResult.count = 1;
                objJsonResult.Message = "删除成功!";
                objJsonResult.data = null;
                return objJsonResult;
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "删除失败!";
                objJsonResult.data = e.ToString();
                return objJsonResult;
            }
        }
        /// <summary>
        /// 获取即时库存wise
        /// </summary>
        /// <returns></returns>
        [Route("Web/Get_ICInventoryByMaterIDList")]
        [HttpGet]
        public object Get_ICInventoryByMaterIDList(string HBarCode, long HWHID, long HSPID, long HOWNERID, string sWhere)
        {
            try
            {
                SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
                ds = oCN.RunProcReturn("exec h_p_KF_ICInventoryByMaterIDList_wise '" + HBarCode + "'," + HWHID + "," + HSPID + "," + HOWNERID + ",'" + sWhere + "'", "ICInventoryByMaterIDList");
                if (ds == null || ds.Tables[0].Rows.Count <= 0)
                {
                    objjson.code = "0";
                    objjson.count = 0;
                    objjson.Message = "获取失败" + DBUtility.ClsPub.sErrInfo;
                    objjson.data = null;
                    return objjson;
                }
                else
                {
                    objjson.code = "1";
                    objjson.count = 1;
                    objjson.Message = "获取成功!";
                    objjson.data = ds.Tables[0];
                    return objjson;
                }
            }
            catch (Exception ex)
            {
                objjson.code = "0";
                objjson.count = 0;
                objjson.Message = "获取失败" + ex.ToString();
                objjson.data = null;
                return objjson;
            }
        }
        #region 基础资料
        /// <summary>