yusijie
2025-01-09 c34e85eda515636993b37a752b52c0f43ae6e17b
WebAPI/Controllers/ÌõÂë¹ÜÀí/WEBSController.cs
@@ -1345,6 +1345,9 @@
        {
            try
            {
                //根据托条码字段删除本单条码出入库缓存表数据
                oCn.RunProc("Delete from KF_PonderationBillMain_Temp where HBarCode_Pack<>'' and HInterID=" + HInterID.ToString() + " and HBillType='" + HBillType + "' and HBarCode_Pack='" + HBarCode + "'", ref DBUtility.ClsPub.sExeReturnInfo);
                //根据条码字段删除本单条码出入库缓存表数据
                oCn.RunProc("Delete from KF_PonderationBillMain_Temp where HBarCode<>'' and HInterID=" + HInterID.ToString() + " and HBillType='" + HBillType + "' and HBarCode='" + HBarCode + "'", ref DBUtility.ClsPub.sExeReturnInfo);
                objJsonResult.code = "0";
                objJsonResult.count = 1;
@@ -2130,6 +2133,61 @@
        #endregion
        #region ç”Ÿäº§å…¥åº“    æ ¡éªŒæ¨¡å¼
        /// <summary>
        /// ç”Ÿäº§å…¥åº“校验上传
        /// </summary>
        /// <returns></returns>
        [Route("WEBSController/set_SaveProductInBill_BillCheck_Json")]
        [HttpPost]
        public object set_SaveProductInBill_BillCheck_Json([FromBody] JObject oMain)
        {
            var _value = oMain["oMain"].ToString();
            string msg1 = _value.ToString();
            try
            {
                List<Model.ClsKf_ProductInBillMain> lsmain = new List<Model.ClsKf_ProductInBillMain>();
                ListModels oListModels = new ListModels();
                lsmain = oListModels.getProductInBillMainByJson(msg1);
                WebAPI.WebS.ClsKf_ProductInBillMain websLsmain = new WebS.ClsKf_ProductInBillMain();
                websLsmain.HInterID = lsmain[0].HInterID;
                websLsmain.HBillNo = lsmain[0].HBillNo;
                websLsmain.HBillType = "1202";
                websLsmain.HSTOCKORGID = lsmain[0].HSTOCKORGID;
                if (oWebs.set_SaveProductInBill_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 é‡‡è´­å…¥åº“    ä¸Šä¼ ç”Ÿå•
@@ -2216,6 +2274,60 @@
        #endregion
        #region é‡‡è´­å…¥åº“    æ ¡éªŒæ¨¡å¼
        /// <summary>
        /// é‡‡è´­å…¥åº“校验上传
        /// </summary>
        /// <returns></returns>
        [Route("WEBSController/set_SavePOStockInBill_BillCheck_Json")]
        [HttpPost]
        public object set_SavePOStockInBill_BillCheck_Json([FromBody] JObject oMain)
        {
            var _value = oMain["oMain"].ToString();
            string msg1 = _value.ToString();
            try
            {
                List<Model.ClsKf_POStockInBillMain> lsmain = new List<Model.ClsKf_POStockInBillMain>();
                ListModels oListModels = new ListModels();
                lsmain = oListModels.getPOStockInBillMainByJson(msg1);
                WebAPI.WebS.ClsKf_POStockInBillMain websLsmain = new WebS.ClsKf_POStockInBillMain();
                websLsmain.HInterID = lsmain[0].HInterID;
                websLsmain.HBillNo = lsmain[0].HBillNo;
                websLsmain.HBillType = "1201";
                websLsmain.HSTOCKORGID = lsmain[0].HSTOCKORGID;
                if (oWebs.set_SavePOStockInBill_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
@@ -2399,15 +2511,12 @@
        {
            var _value = oMain["oMain"].ToString();
            string msg1 = _value.ToString();
            string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries);
            string sMainStr = sArray[0].ToString();             //单据数据
            string HSourceBarCodeCtl = sArray[1].ToString();    //校验-是否进行源单对应条码核对('Y'为核对)
            try
            {
                List<Model.ClsKf_OtherInBillMain> lsmain = new List<Model.ClsKf_OtherInBillMain>();
                ListModels oListModels = new ListModels();
                lsmain = oListModels.getOtherInBillMainByJson(sMainStr);
                lsmain = oListModels.getOtherInBillMainByJson(msg1);
                WebAPI.WebS.ClsKf_OtherInBillMain websLsmain = new WebS.ClsKf_OtherInBillMain();
@@ -2416,45 +2525,21 @@
                websLsmain.HBillType = "1203";
                websLsmain.HSTOCKORGID = lsmain[0].HSTOCKORGID;
                //原单据为扫码生成,对原扫描的条码进行核对
                if (HSourceBarCodeCtl == "Y")
                if (oWebs.set_SaveOtherInBill_BillCheck(websLsmain, ref DBUtility.ClsPub.sErrInfo))
                {
                    if (oWebs.set_SaveOtherInBill_CLD_BillCheck_Verify(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;
                    }
                    objJsonResult.code = "0";
                    objJsonResult.count = 1;
                    objJsonResult.Message = DBUtility.ClsPub.sErrInfo;  //成功!
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                //原单据非扫码生成
                else
                {
                    if (oWebs.set_SaveOtherInBill_CLD_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;
                    }
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = DBUtility.ClsPub.sErrInfo;  //失败!
                    objJsonResult.data = null;
                    return objJsonResult;
                }
            }
            catch (Exception e)
@@ -2561,6 +2646,61 @@
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "领料出库单上传失败!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        #region é¢†æ–™å‡ºåº“    æ ¡éªŒæ¨¡å¼
        /// <summary>
        /// é¢†æ–™å‡ºåº“校验上传
        /// </summary>
        /// <returns></returns>
        [Route("WEBSController/set_SaveMateOutBill_BillCheck_Json")]
        [HttpPost]
        public object set_SaveMateOutBill_BillCheck_Json([FromBody] JObject oMain)
        {
            var _value = oMain["oMain"].ToString();
            string msg1 = _value.ToString();
            try
            {
                List<Model.ClsKf_MateOutBillMain> lsmain = new List<Model.ClsKf_MateOutBillMain>();
                ListModels oListModels = new ListModels();
                lsmain = oListModels.getMateOutBillMainByJson(msg1);
                WebAPI.WebS.ClsKf_MateOutBillMain websLsmain = new WebS.ClsKf_MateOutBillMain();
                websLsmain.HInterID = lsmain[0].HInterID;
                websLsmain.HBillNo = lsmain[0].HBillNo;
                websLsmain.HBillType = "1204";
                websLsmain.HSTOCKORGID = lsmain[0].HSTOCKORGID;
                if (oWebs.set_SaveMateOutBill_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;
            }
@@ -2922,6 +3062,61 @@
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "其他出库单上传失败!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        #region å…¶ä»–出库    æ ¡éªŒæ¨¡å¼
        /// <summary>
        /// å…¶ä»–出库校验上传
        /// </summary>
        /// <returns></returns>
        [Route("WEBSController/set_SaveOtherOutBill_BillCheck_Json")]
        [HttpPost]
        public object set_SaveOtherOutBill_BillCheck_Json([FromBody] JObject oMain)
        {
            var _value = oMain["oMain"].ToString();
            string msg1 = _value.ToString();
            try
            {
                List<Model.ClsKf_OtherOutBillMain> lsmain = new List<Model.ClsKf_OtherOutBillMain>();
                ListModels oListModels = new ListModels();
                lsmain = oListModels.getOtherOutBillMainByJson(msg1);
                WebAPI.WebS.ClsKf_OtherOutBillMain websLsmain = new WebS.ClsKf_OtherOutBillMain();
                websLsmain.HInterID = lsmain[0].HInterID;
                websLsmain.HBillNo = lsmain[0].HBillNo;
                websLsmain.HBillType = "1206";
                websLsmain.HSTOCKORGID = lsmain[0].HSTOCKORGID;
                if (oWebs.set_SaveOtherOutBill_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;
            }
@@ -8883,6 +9078,179 @@
            }
        }
        #endregion
        #region é”€å”®å‡ºåº“追溯记录报表
        /// <summary>
        /// èŽ·å–é”€å”®å‡ºåº“è¿½æº¯è®°å½•
        /// </summary>
        /// <returns></returns>
        [Route("WEBSController/GetKf_SellOutBarTraceReport_Json")]
        [HttpGet]
        public object GetKf_SellOutBarTraceReport_Json(DateTime HBeginDate, DateTime HEndDate, string HBarCode, Int64 HStockOrgID, string HWhere)
        {
            try
            {
                ds = oCn.RunProcReturn("exec h_p_Kf_SellOutBarTraceReport '" + HBeginDate.ToShortDateString() + "','" + HEndDate.ToShortDateString() + "','" + HBarCode + "'," + HStockOrgID.ToString() + ",'" + HWhere + "'", "h_p_Kf_SellOutBarTraceReport");
                List<object> columnNameList = new List<object>();
                //添加列名
                foreach (DataColumn col in ds.Tables[0].Columns)
                {
                    Type dataType = col.DataType;
                    string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
                    columnNameList.Add(JsonConvert.DeserializeObject(ColmString));  //获取到DataColumn列对象的列名
                }
                objJsonResult.code = "0";
                objJsonResult.count = 1;
                objJsonResult.Message = "成功!";
                objJsonResult.data = ds.Tables[0];
                objJsonResult.list = columnNameList;
                return objJsonResult;
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "查询销售出库追溯记录信息失败!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        #region ä»“库出入库报表
        #region èŽ·å–å•æ®ç±»åž‹ä¿¡æ¯
        /// <summary>
        /// èŽ·å–å•æ®ç±»åž‹ä¿¡æ¯
        /// </summary>
        /// <returns></returns>
        [Route("WEBSController/GetICStockBill_BillType_Json")]
        [HttpGet]
        public object GetICStockBill_BillType_Json()
        {
            try
            {
                ds = oCn.RunProcReturn("exec h_p_KF_StockInOutReport_BillType ", "h_p_KF_StockInOutReport_BillType");
                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;
            }
        }
        #endregion
        #region ä»“库出入库明细报表
        /// <summary>
        /// ä»“库出入库明细报表
        /// </summary>
        /// <returns></returns>
        [Route("WEBSController/GetKF_StockInOutEntryReport_Json")]
        [HttpGet]
        public object GetKF_StockInOutEntryReport_Json(string sWhere)
        {
            try
            {
                ds = oCn.RunProcReturn("exec h_p_KF_StockInOutEntryReport " + sWhere, "h_p_KF_StockInOutEntryReport");
                if (ds == null || ds.Tables[0].Rows.Count == 0)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "当前所输入过滤条件,没有返回任何结果!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                else
                {
                    List<object> columnNameList = new List<object>();
                    //添加列名
                    foreach (DataColumn col in ds.Tables[0].Columns)
                    {
                        Type dataType = col.DataType;
                        string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
                        columnNameList.Add(JsonConvert.DeserializeObject(ColmString));  //获取到DataColumn列对象的列名
                    }
                    objJsonResult.code = "0";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "成功!";
                    objJsonResult.data = ds.Tables[0];
                    objJsonResult.list = columnNameList;
                    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/GetKF_StockInOutRecordReport_Json")]
        [HttpGet]
        public object GetKF_StockInOutRecordReport_Json(string sWhere)
        {
            try
            {
                ds = oCn.RunProcReturn("exec h_p_KF_StockInOutRecordReport " + sWhere, "h_p_KF_StockInOutRecordReport");
                if (ds == null || ds.Tables[0].Rows.Count == 0)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "当前所输入过滤条件,没有返回任何结果!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                else
                {
                    List<object> columnNameList = new List<object>();
                    //添加列名
                    foreach (DataColumn col in ds.Tables[0].Columns)
                    {
                        Type dataType = col.DataType;
                        string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
                        columnNameList.Add(JsonConvert.DeserializeObject(ColmString));  //获取到DataColumn列对象的列名
                    }
                    objJsonResult.code = "0";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "成功!";
                    objJsonResult.data = ds.Tables[0];
                    objJsonResult.list = columnNameList;
                    return objJsonResult;
                }
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "查询仓库出入库记录信息失败!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        #endregion
        #endregion
        #region å®¢æˆ·æ¡ç æ‰«æè®°å½•单