ch
2022-10-25 43efa9e547e6c7dc79767571c0186707519e4702
WebAPI/Controllers/²Ö´æ¹ÜÀí/ÌõÂëÉú³É/Sc_BarCodeController.cs
@@ -259,6 +259,34 @@
        }
        #endregion
        #region [通过条码编号获取HItemId]
        [Route("Sc_BarCode/Get_HItemId")]
        [HttpGet]
        public object Get_HItemId(string sWhere)
        {
            List<object> columnNameList = new List<object>();
            try
            {
                ds = oCN.RunProcReturn("select * from h_v_IF_BarCodeBillList where æ¡ç ç¼–号 =  '" + sWhere + "'", "h_v_IF_BarCodeBillList");
                objJsonResult.code = "1";
                objJsonResult.count = 1;
                objJsonResult.Message = "Sucess!";
                objJsonResult.data = ds.Tables[0];
                return objJsonResult;
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = e.Message.ToString();
                objJsonResult.data = null;
                objJsonResult.list = columnNameList;
            }
            return objJsonResult;
        }
        #endregion
        #region [通过选择的源单信息查找源单数据]
        [Route("Sc_BarCode/SelectReportFromBillList")]
        [HttpPost]
@@ -480,6 +508,73 @@
        #endregion
        #region [同步资料]
        [Route("Sc_BarCode/Sync_data")]
        [HttpGet]
        public object Sync_data()
        {
            SQLHelper.ClsCN oCn = new SQLHelper.ClsCN();
            try
            {
                oCn.RunProc("exec h_p_IF_ERPDataToLocal", ref DBUtility.ClsPub.sExeReturnInfo);
                objJsonResult.code = "1";
                objJsonResult.count = 1;
                objJsonResult.Message = "同步基础资料成功!";
                objJsonResult.data = null;
                return objJsonResult;
            }
            catch (Exception e)
            {
                objJsonResult.code = "1";
                objJsonResult.count = 1;
                objJsonResult.Message = "同步基础资料失败!" + e;
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        #region [批次]
        [Route("Sc_BarCode/Batch")]
        [HttpGet]
        public object Batch(int HMaterID, string HBatchNo)
        {
            SQLHelper.ClsCN oCn = new SQLHelper.ClsCN();
            bool b = false;
            if (HMaterID != 0)
            {
                DataSet oDs = oCn.RunProcReturn("exec h_p_Gy_BarCodeBill_GetBatchNo " + HMaterID.ToString() + ",'" + HBatchNo + "','" + "" + "','" + "" + "'", "h_p_Gy_BarCodeBill_GetBatchNo");
                //
                if (oDs == null && oDs.Tables[0].Rows.Count == 0)
                {
                    objJsonResult.code = "1";
                    objJsonResult.Message="生成批次失败!";
                    return objJsonResult;
                }
                else if (DBUtility.ClsPub.isStrNull(oDs.Tables[0].Rows[0][0]) == "1")
                {
                    objJsonResult.code = "1";
                    objJsonResult.Message = "生成批次成功!";
                    objJsonResult.data = DBUtility.ClsPub.isStrNull(oDs.Tables[0].Rows[0]["HBatchNo"]);
                    HBatchNo = DBUtility.ClsPub.isStrNull(oDs.Tables[0].Rows[0]["HBatchNo"]);
                    b = true;
                    return objJsonResult;
                }
            }
            //明细表是否为零行
            if (b == false)
            {
                objJsonResult.code = "1";
                objJsonResult.Message="没有需要生成批次的明细行!";
                return objJsonResult;
            }
            else //完全封闭
            {
                return null;
            }
        }
        #endregion
        #region [条码生成接口]
        [Route("Sc_BarCode/Sub_SaveBill")]
        [HttpPost]
@@ -536,7 +631,7 @@
            }
            return objJsonResult;
        }
        #endregion
        #endregion
        #region[单据完整性判断]
        private bool Sub_AllowSave(string msg2, string HSelectBarCodeType)