1
zrg
2026-01-26 0d19dcc80b6b1864be6813f4caf93996bb505d82
WebAPI/Controllers/ÌõÂë¹ÜÀí/WEBSController.cs
@@ -505,42 +505,22 @@
        {
            try
            {
                Int64 sHSPID = 0;
                Int64 sHWhID = 0;
                if (HBarCode.Contains(";"))
                //条码格式='HSP'+仓库内码+';'+仓位内码
                if (HBarCode.Contains("HSP") && HBarCode.Contains(";"))
                {
                    string[] sArray = HBarCode.Replace("HSP", "").Split(';');
                    sHSPID = DBUtility.ClsPub.isLong(sArray[1]);
                    sHWhID = DBUtility.ClsPub.isLong(sArray[0]);
                }
                    Int64 sHSPID = 0;
                    Int64 sHWhID = 0;
                    if (HBarCode.Contains(";"))
                    {
                        string[] sArray = HBarCode.Replace("HSP", "").Split(';');
                        sHSPID = DBUtility.ClsPub.isLong(sArray[1]);
                        sHWhID = DBUtility.ClsPub.isLong(sArray[0]);
                    }
                if (HWhID == 0)
                {
                    ds = oCn.RunProcReturn("select HItemID,HNumber,HName,HWHID,HWhNumber,HWhName from h_v_IF_StockPlace where HStopflag=0 and HItemID=" + sHSPID.ToString() + " and HWHID=" + sHWhID.ToString() + " and HUSEORGID = " + HStockOrgID.ToString(), "h_v_IF_StockPlace");
                    if (ds == null || ds.Tables[0].Rows.Count == 0)
                    if (HWhID == 0)
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "没有返回任何记录,请确认所扫仓位条码是否属于该组织,且为非禁用状态!";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    else
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "成功!";
                        objJsonResult.data = ds.Tables[0];
                        return objJsonResult;
                    }
                }
                else
                {
                    ds = oCn.RunProcReturn("select HItemID,HNumber,HName,HWHID,HWhNumber,HWhName from h_v_IF_StockPlace where HStopflag=0 and HItemID=" + sHSPID.ToString() + " and HWHID=" + HWhID.ToString() + " and HUSEORGID = " + HStockOrgID.ToString(), "h_v_IF_StockPlace");
                    if (ds == null || ds.Tables[0].Rows.Count == 0)
                    {
                        DataSet ds2 = oCn.RunProcReturn("select HItemID,HNumber,HName,HWHID,HWhNumber,HWhName from h_v_IF_StockPlace where HStopflag=0 and HItemID=" + sHSPID.ToString() + " and HWHID=" + sHWhID.ToString() + " and HUSEORGID = " + HStockOrgID.ToString(), "h_v_IF_StockPlace");
                        if (ds2 == null || ds2.Tables[0].Rows.Count == 0)
                        ds = oCn.RunProcReturn("select HItemID,HNumber,HName,HWHID,HWhNumber,HWhName from h_v_IF_StockPlace where HStopflag=0 and HItemID=" + sHSPID.ToString() + " and HWHID=" + sHWhID.ToString() + " and HUSEORGID = " + HStockOrgID.ToString(), "h_v_IF_StockPlace");
                        if (ds == null || ds.Tables[0].Rows.Count == 0)
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
@@ -553,9 +533,53 @@
                            objJsonResult.code = "0";
                            objJsonResult.count = 1;
                            objJsonResult.Message = "成功!";
                            objJsonResult.data = ds2.Tables[0];
                            objJsonResult.data = ds.Tables[0];
                            return objJsonResult;
                        }
                    }
                    else
                    {
                        ds = oCn.RunProcReturn("select HItemID,HNumber,HName,HWHID,HWhNumber,HWhName from h_v_IF_StockPlace where HStopflag=0 and HItemID=" + sHSPID.ToString() + " and HWHID=" + HWhID.ToString() + " and HUSEORGID = " + HStockOrgID.ToString(), "h_v_IF_StockPlace");
                        if (ds == null || ds.Tables[0].Rows.Count == 0)
                        {
                            DataSet ds2 = oCn.RunProcReturn("select HItemID,HNumber,HName,HWHID,HWhNumber,HWhName from h_v_IF_StockPlace where HStopflag=0 and HItemID=" + sHSPID.ToString() + " and HWHID=" + sHWhID.ToString() + " and HUSEORGID = " + HStockOrgID.ToString(), "h_v_IF_StockPlace");
                            if (ds2 == null || ds2.Tables[0].Rows.Count == 0)
                            {
                                objJsonResult.code = "0";
                                objJsonResult.count = 0;
                                objJsonResult.Message = "没有返回任何记录,请确认所扫仓位条码是否属于该组织,且为非禁用状态!";
                                objJsonResult.data = null;
                                return objJsonResult;
                            }
                            else
                            {
                                objJsonResult.code = "0";
                                objJsonResult.count = 1;
                                objJsonResult.Message = "成功!";
                                objJsonResult.data = ds2.Tables[0];
                                return objJsonResult;
                            }
                        }
                        else
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 1;
                            objJsonResult.Message = "成功!";
                            objJsonResult.data = ds.Tables[0];
                            return objJsonResult;
                        }
                    }
                }
                else
                {
                    ds = oCn.RunProcReturn("select HItemID,HNumber,HName,HWHID,HWhNumber,HWhName from h_v_IF_StockPlace where HStopflag=0 and HBarCode='" + HBarCode + "' and HUSEORGID = " + HStockOrgID.ToString(), "h_v_IF_StockPlace");
                    if (ds == null || ds.Tables[0].Rows.Count == 0)
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "没有返回任何记录,请确认所扫仓位条码是否属于该组织,且为非禁用状态!";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    else
                    {
@@ -1094,7 +1118,7 @@
                }
                else
                {
                    objJsonResult.code = "0";
                    objJsonResult.code = "1";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "成功!";
                    objJsonResult.data = ds.Tables[0];
@@ -4846,6 +4870,62 @@
        #endregion
        #region ç”Ÿäº§é€€æ–™    æ ¡éªŒæ¨¡å¼
        /// <summary>
        /// ç”Ÿäº§é€€æ–™æ ¡éªŒä¸Šä¼ 
        /// </summary>
        /// <returns></returns>
        [Route("WEBSController/set_SaveMateOutBackBill_BillCheck_Json")]
        [HttpPost]
        public object set_SaveMateOutBackBill_BillCheck_Json([FromBody] JObject oMain)
        {
            var _value = oMain["oMain"].ToString();
            string msg1 = _value.ToString();
            try
            {
                List<Model.ClsKf_ICStockBillMain> lsmain = new List<Model.ClsKf_ICStockBillMain>();
                ListModels oListModels = new ListModels();
                lsmain = oListModels.getICStockBillMainByJson(msg1);
                WebAPI.WebS.ClsKf_ICStockBillMain websLsmain = new WebS.ClsKf_ICStockBillMain();
                websLsmain.HInterID = lsmain[0].HInterID;
                websLsmain.HBillNo = lsmain[0].HBillNo;
                websLsmain.HBillType = "1244";
                websLsmain.HMaker = lsmain[0].HMaker;
                websLsmain.HSTOCKORGID = lsmain[0].HSTOCKORGID;
                if (oWebs.set_SaveMateOutBackBill_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 é”€å”®é€€è´§    ä¸Šä¼ ç”Ÿå•
@@ -5226,6 +5306,28 @@
                }
                else
                {
                    //删除前控制=========================================
                    DataSet dds = oCn.RunProcReturn("Exec h_p_KF_ICInventory_WorkShop_BeforeDelCtrl " + mainList[0].HInterID.ToString()  , "h_p_KF_ICInventory_WorkShop_BeforeDelCtrl");
                    if (dds == null)
                    {
                        oCn.RollBack();
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "删除前判断失败!";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    if (DBUtility.ClsPub.isStrNull(dds.Tables[0].Rows[0]["HBack"]) != "0")
                    {
                        oCn.RollBack();
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "删除失败!" + DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]);
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    //更新车间物料库存
                    oCn.RunProc("EXEC h_p_WMS_UPDateICinventory_WorkShop " + mainList[0].HInterID.ToString() + ",'" + mainList[0].HBillType + "'");
                    //更新车间条码库存
@@ -7052,6 +7154,76 @@
                        sAutoBarCode = "Y";
                    }
                }
                //采购退料单
                else if (HBillType == "1239")
                {
                    //校验-是否进行源单对应条码核对('Y'为核对)
                    if (oSystemParameter.omodel.Kf_POStockInBackBillCheck_SourceBarCodeCtl.ToUpper() == "Y")
                    {
                        sSourceBarCodeCtl = "Y";
                    }
                    //免扫物料条码模式('Y'为不扫物料条码)
                    if (oSystemParameter.omodel.Kf_POStockInBackBillCheck_AutoBarCode.ToUpper() == "Y")
                    {
                        sAutoBarCode = "Y";
                    }
                }
                //生产退库单
                else if (HBillType == "1245")
                {
                    //校验-是否进行源单对应条码核对('Y'为核对)
                    if (oSystemParameter.omodel.Kf_ProductInBackBillCheck_SourceBarCodeCtl.ToUpper() == "Y")
                    {
                        sSourceBarCodeCtl = "Y";
                    }
                    //免扫物料条码模式('Y'为不扫物料条码)
                    if (oSystemParameter.omodel.Kf_ProductInBackBillCheck_AutoBarCode.ToUpper() == "Y")
                    {
                        sAutoBarCode = "Y";
                    }
                }
                //生产退料单
                else if (HBillType == "1244")
                {
                    //校验-是否进行源单对应条码核对('Y'为核对)
                    if (oSystemParameter.omodel.Kf_MateOutBackBillCheck_SourceBarCodeCtl.ToUpper() == "Y")
                    {
                        sSourceBarCodeCtl = "Y";
                    }
                    //免扫物料条码模式('Y'为不扫物料条码)
                    if (oSystemParameter.omodel.Kf_MateOutBackBillCheck_AutoBarCode.ToUpper() == "Y")
                    {
                        sAutoBarCode = "Y";
                    }
                }
                //销售退货单
                else if (HBillType == "1247")
                {
                    //校验-是否进行源单对应条码核对('Y'为核对)
                    if (oSystemParameter.omodel.Kf_SellOutBackBillCheck_SourceBarCodeCtl.ToUpper() == "Y")
                    {
                        sSourceBarCodeCtl = "Y";
                    }
                    //免扫物料条码模式('Y'为不扫物料条码)
                    if (oSystemParameter.omodel.Kf_SellOutBackBillCheck_AutoBarCode.ToUpper() == "Y")
                    {
                        sAutoBarCode = "Y";
                    }
                }
                //委外退料单
                else if (HBillType == "1238")
                {
                    //校验-是否进行源单对应条码核对('Y'为核对)
                    if (oSystemParameter.omodel.Kf_EntrustOutBackBillCheck_SourceBarCodeCtl.ToUpper() == "Y")
                    {
                        sSourceBarCodeCtl = "Y";
                    }
                    //免扫物料条码模式('Y'为不扫物料条码)
                    if (oSystemParameter.omodel.Kf_EntrustOutBackBillCheck_AutoBarCode.ToUpper() == "Y")
                    {
                        sAutoBarCode = "Y";
                    }
                }
                #endregion
                if (oSystemParameter.omodel.WMS_CampanyName == "安瑞") //系统参数  å®¢æˆ·å®šåˆ¶åŒ–名称     ç©ºç™½ä¸ºé€šç”¨
@@ -7718,6 +7890,51 @@
                    //先进先出控制
                    sFIFOCtl = oSystemParameter.omodel.Kf_MoveStockBillCheck_FIFOCtl;
                }
                //采购退料单
                else if (HBillType == "1239")
                {
                    //校验-是否进行源单对应条码核对('Y'为核对)
                    if (oSystemParameter.omodel.Kf_POStockInBackBillCheck_SourceBarCodeCtl.ToUpper() == "Y")
                    {
                        sSourceBarCodeCtl = "Y";
                    }
                }
                //生产退库单
                else if (HBillType == "1245")
                {
                    //校验-是否进行源单对应条码核对('Y'为核对)
                    if (oSystemParameter.omodel.Kf_ProductInBackBillCheck_SourceBarCodeCtl.ToUpper() == "Y")
                    {
                        sSourceBarCodeCtl = "Y";
                    }
                }
                //生产退料单
                else if (HBillType == "1244")
                {
                    //校验-是否进行源单对应条码核对('Y'为核对)
                    if (oSystemParameter.omodel.Kf_MateOutBackBillCheck_SourceBarCodeCtl.ToUpper() == "Y")
                    {
                        sSourceBarCodeCtl = "Y";
                    }
                }
                //销售退货单
                else if (HBillType == "1247")
                {
                    //校验-是否进行源单对应条码核对('Y'为核对)
                    if (oSystemParameter.omodel.Kf_SellOutBackBillCheck_SourceBarCodeCtl.ToUpper() == "Y")
                    {
                        sSourceBarCodeCtl = "Y";
                    }
                }
                //委外退料单
                else if (HBillType == "1238")
                {
                    //校验-是否进行源单对应条码核对('Y'为核对)
                    if (oSystemParameter.omodel.Kf_EntrustOutBackBillCheck_SourceBarCodeCtl.ToUpper() == "Y")
                    {
                        sSourceBarCodeCtl = "Y";
                    }
                }
                #endregion
                //原单据为扫码生成,对原扫描的条码进行核对,删除条码出入库校验缓存记录
@@ -8032,6 +8249,51 @@
                        sSourceBarCodeCtl = "Y";
                    }
                }
                //采购退料单
                else if (HBillType == "1239")
                {
                    //校验-是否进行源单对应条码核对('Y'为核对)
                    if (oSystemParameter.omodel.Kf_POStockInBackBillCheck_SourceBarCodeCtl.ToUpper() == "Y")
                    {
                        sSourceBarCodeCtl = "Y";
                    }
                }
                //生产退库单
                else if (HBillType == "1245")
                {
                    //校验-是否进行源单对应条码核对('Y'为核对)
                    if (oSystemParameter.omodel.Kf_ProductInBackBillCheck_SourceBarCodeCtl.ToUpper() == "Y")
                    {
                        sSourceBarCodeCtl = "Y";
                    }
                }
                //生产退料单
                else if (HBillType == "1244")
                {
                    //校验-是否进行源单对应条码核对('Y'为核对)
                    if (oSystemParameter.omodel.Kf_MateOutBackBillCheck_SourceBarCodeCtl.ToUpper() == "Y")
                    {
                        sSourceBarCodeCtl = "Y";
                    }
                }
                //销售退货单
                else if (HBillType == "1247")
                {
                    //校验-是否进行源单对应条码核对('Y'为核对)
                    if (oSystemParameter.omodel.Kf_SellOutBackBillCheck_SourceBarCodeCtl.ToUpper() == "Y")
                    {
                        sSourceBarCodeCtl = "Y";
                    }
                }
                //委外退料单
                else if (HBillType == "1238")
                {
                    //校验-是否进行源单对应条码核对('Y'为核对)
                    if (oSystemParameter.omodel.Kf_EntrustOutBackBillCheck_SourceBarCodeCtl.ToUpper() == "Y")
                    {
                        sSourceBarCodeCtl = "Y";
                    }
                }
                #endregion
                try
@@ -8321,11 +8583,7 @@
        #endregion
        #region ç”Ÿäº§ç»„托单模块 æ‰«æå®¢æˆ·ç®±ï¼ˆæ‰˜ï¼‰æ¡ç  -凯贝装箱单     20251103
        /// <summary>
        /// ç”Ÿäº§ç»„托单模块 æ‰«æç®±ï¼ˆæ‰˜ï¼‰æ¡ç 
        /// </summary>
        /// <returns></returns>
        [Route("WEBSController/Get_PackBarCode_PackUnionBill_New_Json_Cus")]
        [HttpGet]
        public object Get_PackBarCode_PackUnionBill_New_Json_Cus(Int64 HInterID, string HBillNo, string HBillType, string HBillSubType, string HBarCode_Pack, string HSourceBillNo)
@@ -13361,11 +13619,11 @@
        /// <returns></returns>
        [Route("WEBSController/BindCarAndWH")]
        [HttpGet]
        public object BindCarAndWH( string HMaker, Int64 HWhID, Int64 HSPID, string HCarBarCode, Int64 HStockOrgID)
        public object BindCarAndWH( string HMaker, Int64 HWhID, Int64 HSPID, string HCarBarCode, Int64 HStockOrgID,int bindsignal)
        {
            try
            {
                ds = oCn.RunProcReturn("exec h_p_bindingCarintoWh "  + HWhID.ToString() + "," + HSPID.ToString() + ",'" + HCarBarCode + "','" + HMaker+ "'," + HStockOrgID.ToString(), "h_p_bindingCarintoWh");
                ds = oCn.RunProcReturn("exec h_p_bindingCarintoWh "  + HWhID.ToString() + "," + HSPID.ToString() + ",'" + HCarBarCode + "','" + HMaker+ "'," + HStockOrgID.ToString()+","+ bindsignal, "h_p_bindingCarintoWh");
                if (ds == null || ds.Tables[0].Rows.Count == 0)
                {
                    objJsonResult.code = "0";
@@ -13405,7 +13663,8 @@
        }
        #endregion
        //转移模块
        #region è½¬ç§»æ¨¡å—
        // è½¬ç§»æ¨¡å—
        [Route("WEBSController/CheckHW")]
        [HttpGet]
        public object CheckHW(int  HWhID,int HSPID,int HWhID2,int HSPID2,string HBarCode,string HCarBarCode1,string HCarBarCode2,string UserID)
@@ -13450,8 +13709,9 @@
                return objJsonResult;
            }
        }
        #endregion
       #region æƒ åº· ç”Ÿäº§é¢†æ–™å•校验 æ‰«ææºå• èŽ·å–ç”Ÿäº§é¢†æ–™å•å’Œä¸‹æ¸¸é¢†æ–™å•æœªå®¡æ ¸ å•据
        #region æƒ åº· ç”Ÿäº§é¢†æ–™å•校验 æ‰«ææºå• èŽ·å–ç”Ÿäº§é¢†æ–™å•å’Œä¸‹æ¸¸é¢†æ–™å•æœªå®¡æ ¸ å•据
        [Route("WEBSController/get_BillBarCode_BillCheck_Json_MateOut_HuiKang")]
        [HttpGet]
        public Object get_BillBarCode_BillCheck_Json_MateOut_HuiKang(string HBillNo, string HBillType, string HMaker, Int64 HStockOrgID)
@@ -13563,5 +13823,164 @@
        #endregion
        #region æ£€éªŒå• æ‰«ææºå• æ ¹æ®å•据类型 æºå•类型 æºå•号 è§£æžå¹¶è¿”回检验项目
        [Route("WEBSController/get_CheckBillBarCode_Json_CheckItem")]
        [HttpGet]
        public Object get_CheckBillBarCode_Json_CheckItem(int HBillType, int HSourceBillType, string HBarCode, string HInterID, string HEntryID, int Mode,string user)
        {
            try
            {
                // Mode = 1 è¡¨ç¤º æ‰«ç æ¨¡å¼ Mode = 2 è¡¨ç¤º é€‰å•模式
                if(Mode == 1)
                {
                    //扫码模式需要解析条码获取HInterID和HEntryID
                    ds = oCn.RunProcReturn($@"
                    exec h_p_CheckBillBarCode_AnalysisBarcode
                        @HBillType={HBillType},
                        @HSourceBillType={HSourceBillType},
                        @HBarCode={HBarCode},
                        @user = '{user}'
                    ", "h_p_CheckBillBarCode_AnalysisBarcode");
                    if (ds.Tables[0].Rows.Count == 0)
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "扫描单据条码失败!条码解析失败!";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    HInterID = ds.Tables[0].Rows[0]["HInterID"].ToString();
                    HEntryID = ds.Tables[0].Rows[0]["HEntryID"].ToString();
                }
                // é€‰å•模式直接递入HInterID å’Œ HEntryID æ ¹æ® å–质检方案来源 èŽ·å– æ£€éªŒé¡¹ç›®
                ds = oCn.RunProcReturn($@"
                    exec h_p_CheckBillBarCode_CheckItem
                        @HBillType={HBillType},
                        @HSourceBillType={HSourceBillType},
                        @HInterID={HInterID},
                        @HEntryID={HEntryID}
                ", "h_p_CheckBillBarCode_CheckItem");
                if(ds.Tables[0].Rows.Count == 0)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "扫描单据条码失败!无绑定质检方案信息";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                objJsonResult.code = "1";
                objJsonResult.count = 1;
                objJsonResult.Message = "success!";
                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 å‡¯è´ è£…箱单扫描箱条码查询是否在客户条码档案,不在就解析保存客户条码档案表
        [Route("WEBSController/GetHBarCode_CusJX")]
        [HttpGet]
        public object GetHBarCode_CusJX(Int64 HInterID, string HBillNo, string HBillType, string HBillSubType, string HBarCode_Pack, string HSourceBillNo)
        {
            try
            {
                ds = oCn.RunProcReturn("exec h_p_WMS_AddPackBarCode_PackUnionBill_New_CusJX " + HInterID.ToString() + ",'" + HBillNo + "','" + HBillType + "','" + HBillSubType + "','" + HBarCode_Pack + "','" + HSourceBillNo + "'", "h_p_WMS_AddPackBarCode_PackUnionBill_New_CusJX");
                if (ds == null || ds.Tables[0].Rows.Count == 0)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "扫描箱、托条码发生错误!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                else if (DBUtility.ClsPub.isLong(ds.Tables[0].Rows[0]["HBack"]) == 1)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HRemark"]);
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                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;
            }
        }
        #endregion
        #region æ·»åº·æ ¹æ®å°è½¦æ¡ç æ‰¾å‡ºç›¸åº”物料
        [Route("WEBSController/GetMaterIDByCarBarCode")]
        [HttpGet]
        public object GetMaterIDByCarBarCode(string CarBarCode)
        {
            try
            {
                ds = oCn.RunProcReturn("select * from GetMaterMesByCarBarCode where å°è½¦='" + CarBarCode.ToString() + "'" , "GetMaterMesByCarBarCode");
                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
    }
}