1
zrg
2025-10-13 52e7ae2d80e3292c850e1c93836d4c376cc0dfd5
WebAPI/Controllers/ÌõÂë¹ÜÀí/WEBSController.cs
@@ -72,7 +72,7 @@
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    else if (DBUtility.ClsPub.isLong(ds2.Tables[0].Rows[0]["HBack"])==1)
                    else if (DBUtility.ClsPub.isLong(ds2.Tables[0].Rows[0]["HBack"]) == 1)
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
@@ -111,6 +111,8 @@
        #endregion
        #region ç”¨æˆ·æ¨¡å—权限判断
        #region ç”¨æˆ·æ¨¡å—权限判断    åˆ¤æ–­é‡‘蝶账号是否正确
        /// <summary>
        /// è¿›å…¥æ¨¡å—时进行用户权限判断
@@ -184,6 +186,48 @@
                return objJsonResult;
            }
        }
        #endregion
        #region ç”¨æˆ·æ¨¡å—权限判断
        /// <summary>
        /// è¿›å…¥æ¨¡å—时进行用户权限判断
        /// </summary>
        /// <returns></returns>
        [Route("WEBSController/CheckModRight_ERP_Json")]
        [HttpGet]
        public object CheckModRight_ERP_Json(string ModRightName, string HUserName)
        {
            try
            {
                //判断权限
                if (!DBUtility.ClsPub.Security_Log(ModRightName, 3, false, HUserName))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "您没有对应模块权限,请与管理员联系!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                objJsonResult.code = "0";
                objJsonResult.count = 1;
                objJsonResult.Message = "成功!";
                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
@@ -470,7 +514,7 @@
                    sHWhID = DBUtility.ClsPub.isLong(sArray[0]);
                }
                if(HWhID==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)
@@ -1028,13 +1072,13 @@
        /// <returns></returns>
        [Route("WEBSController/GetEquipList_Json")]
        [HttpGet]
        public object GetEquipList_Json(string Equip,int HCenterID)
        public object GetEquipList_Json(string Equip, int HCenterID)
        {
            try
            {
                if (HCenterID !=0)
                if (HCenterID != 0)
                {
                    ds = oCn.RunProcReturn("select HInterID,HEquipFileNumber,HName,HSourceID,HSourceName,HCenterID from h_v_Gy_EquipFileBill where HCenterID='"+HCenterID+"' and ( HEquipFileNumber like '%" + Equip + "%' or HName like '%" + Equip + "%')", "h_v_Gy_EquipFileBill");
                    ds = oCn.RunProcReturn("select HInterID,HEquipFileNumber,HName,HSourceID,HSourceName,HCenterID from h_v_Gy_EquipFileBill where HCenterID='" + HCenterID + "' and ( HEquipFileNumber like '%" + Equip + "%' or HName like '%" + Equip + "%')", "h_v_Gy_EquipFileBill");
                }
                else
                {
@@ -1605,7 +1649,7 @@
                try
                {
                    if(sFIFOCtl == "Y")
                    if (sFIFOCtl == "Y")
                    {
                        //更新先进先出临时表状态
                        oCn.RunProc("EXEC h_p_WMS_UPDateICInventory_FIFO_Tmp " + HInterID.ToString() + ",'" + HBillType + "'");
@@ -2028,7 +2072,7 @@
        {
            try
            {
                ds = oCn.RunProcReturn("exec h_p_Kf_ICStockBillQueryList_New '" + HBillType + "','" + HBillNo + "','" + HSourceBillNo + "','" + HMaker + "'," + HStockOrgID.ToString() + ",'" + sWhere+"'", "h_p_Kf_ICStockBillQueryList_New");
                ds = oCn.RunProcReturn("exec h_p_Kf_ICStockBillQueryList_New '" + HBillType + "','" + HBillNo + "','" + HSourceBillNo + "','" + HMaker + "'," + HStockOrgID.ToString() + ",'" + sWhere + "'", "h_p_Kf_ICStockBillQueryList_New");
                if (ds == null || ds.Tables[0].Rows.Count == 0)
                {
                    objJsonResult.code = "0";
@@ -2851,7 +2895,7 @@
                websLsmain.HRedBlueFlag = lsmain[0].HRedBlueFlag;
                websLsmain.HStockStyle = lsmain[0].HStockStyle;
                websLsmain.HBillSubType = lsmain[0].HBillSubType;
                if(lsmain[0].HMainSourceBillType== "1241")
                if (lsmain[0].HMainSourceBillType == "1241")
                {
                    websLsmain.HMainSourceBillType = "入库申请单";
                }
@@ -3014,7 +3058,7 @@
                websLsmain.HSTOCKORGID = lsmain[0].HSTOCKORGID;
                websLsmain.HOWNERID = lsmain[0].HSTOCKORGID;
                if(sSourceType== "3710")
                if (sSourceType == "3710")
                {
                    sSourceType = "3720";
                }
@@ -3398,7 +3442,7 @@
                websLsmain.HSTOCKORGID = lsmain[0].HSTOCKORGID;
                websLsmain.HOWNERID = lsmain[0].HSTOCKORGID;
                if (oWebs.set_SaveEntrustOutBill_New(websLsmain, sSourceType, ref DBUtility.ClsPub.sErrInfo))
                {
@@ -4373,6 +4417,10 @@
                {
                    websLsmain.HMainSourceBillType = "退料通知单";
                }
                else if (lsmain[0].HMainSourceBillType == "1201")
                {
                    websLsmain.HMainSourceBillType = "采购入库单";
                }
                else
                {
                    websLsmain.HMainSourceBillType = "手工录入";
@@ -4454,6 +4502,10 @@
                if (lsmain[0].HMainSourceBillType == "3720")
                {
                    websLsmain.HMainSourceBillType = "生产用料清单";
                }
                else if (lsmain[0].HMainSourceBillType == "1204")
                {
                    websLsmain.HMainSourceBillType = "生产领料单";
                }
                else
                {
@@ -5000,7 +5052,7 @@
                lsmain = oListModels.getObjectByJson_Kf_TrolleyPositionBillMain(msg2);
                foreach (Model.ClsKf_TrolleyPositionBillMain oItem in lsmain)
                {
                {
                    DBUtility.ClsPub.CurUserName = oItem.HMaker;
                    oItem.HBillType = "10004";
                    oItem.HBillSubType = "10004";
@@ -5042,7 +5094,7 @@
                bool bResult;
                if (OperationType == "1")
                {
                    bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo);
                    bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo);
                }
                else
                {
@@ -5311,7 +5363,7 @@
            {
                if (oSystemParameter.omodel.WMS_CloudMode.ToUpper() == "N") //系统参数是否为私有云模式,N为公有云模式,Y为私有云模式
                {
                    if(HSourceBillType == "1214")
                    if (HSourceBillType == "1214")
                    {
                        //重新同步生产发料通知单
                        Kf_MateOutRequestBillController obill = new Kf_MateOutRequestBillController();
@@ -5888,7 +5940,7 @@
                    sJXCode = POStockInBillController.JX_Json(sBarCode, HInterID, HBillType, HStockOrgID, HBillNo, HMaker);
                    SourceFlag = true;
                }
                else if(oSystemParameter.omodel.WMS_CampanyName == "森楷" && HSourceBillType == "1241")
                else if (oSystemParameter.omodel.WMS_CampanyName == "森楷" && HSourceBillType == "1241")
                {
                    //自动包装线同步金蝶生产入库申请单
                    sJXCode = Kf_OtherInBill_SK(sBarCode, HCustom1);
@@ -5943,7 +5995,7 @@
                objJsonResult.data = null;
                return objJsonResult;
            }
         }
        }
        #endregion
@@ -6023,7 +6075,7 @@
            {
                if (oSystemParameter.omodel.WMS_CampanyName == "安瑞") //系统参数  å®¢æˆ·å®šåˆ¶åŒ–名称     ç©ºç™½ä¸ºé€šç”¨
                {
                     sJXCode = POStockInBillController.JX_Json(sBarCode, HInterID, HBillType, HStockOutOrgID, HBillNo, HMaker);
                    sJXCode = POStockInBillController.JX_Json(sBarCode, HInterID, HBillType, HStockOutOrgID, HBillNo, HMaker);
                    SourceFlag = true;
                }
                else
@@ -6743,8 +6795,8 @@
                    objJsonResult.Message = "校验模式,扫描条码失败!" + e.ToString();
                    objJsonResult.data = null;
                    return objJsonResult;
                    }
                }
            }
            else
            {
                objJsonResult.code = "0";
@@ -6929,7 +6981,7 @@
        {
            //获取系统参数
            string sErrMsg = "";
            if (oSystemParameter.ShowBillByOrgID(HStockOrgID,ref sErrMsg) == true)
            if (oSystemParameter.ShowBillByOrgID(HStockOrgID, ref sErrMsg) == true)
            {
                string sSourceBarCodeCtl = "N";   //校验-是否进行源单对应条码核对('Y'为核对)
                if (HBillType == "1205" && oSystemParameter.omodel.Kf_SellOutBillCheck_SourceBarCodeCtl.ToUpper() == "Y")
@@ -7572,15 +7624,64 @@
                }
            }
            else
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "获取系统参数失败! " + sErrMsg;
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        #region æ ¡éªŒæ¨¡å—    è¿”回源单列表信息
        /// <summary>
        /// æºå•列表信息,根据单据类型、组织ID返回源单列表信息
        /// </summary>
        /// <returns></returns>
        [Route("WEBSController/GetCheckBillList_Json")]
        [HttpGet]
        public object GetCheckBillList_Json(string HBillType, Int64 HStockOrgID, string HBillNo, string HMater, string HCustom)
        {
            try
            {
                ds = oCn.RunProcReturn("exec h_p_WMS_GetCheckBillList '" + HBillType  + "'," + HStockOrgID.ToString() + ",'" + HBillNo + "','" + HMater + "','" + HCustom + "'", "h_p_WMS_GetCheckBillList");
                if (ds == null || ds.Tables[0].Rows.Count == 0)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "获取系统参数失败! " + sErrMsg;
                    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
@@ -7600,13 +7701,20 @@
        {
            try
            {
                WebS.ClsGy_BarCodeBill_WMS_Model WebSoBarModel = new WebS.ClsGy_BarCodeBill_WMS_Model();
                WebSoBarModel = oWebs.get_PackBarCode_PackUnionBill(HInterID, HBillNo, HBillType, HBarCode_Pack, HMaker, HStockOrgID, ref DBUtility.ClsPub.sErrInfo);
                if (WebSoBarModel == null)
                ds = oCn.RunProcReturn("exec h_p_WMS_AddPackBarCode_PackUnionBill " + HInterID.ToString() + ",'" + HBillNo + "','" + HBillType + "','" + HBarCode_Pack + "','" + HMaker + "'," + HStockOrgID.ToString(), "h_p_WMS_AddPackBarCode_PackUnionBill");
                if (ds == null || ds.Tables[0].Rows.Count == 0)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = DBUtility.ClsPub.sErrInfo;
                    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;
                }
@@ -7614,8 +7722,8 @@
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "成功";
                    objJsonResult.data = WebSoBarModel;
                    objJsonResult.Message = "成功!";
                    objJsonResult.data = ds.Tables[0];
                    return objJsonResult;
                }
            }
@@ -7736,7 +7844,7 @@
            string sErrMsg = "";
            if (oSystemParameter.ShowBillByOrgID(HStockOrgID, ref sErrMsg) == true)
            {
                string sMaterialCtl = "Y";          //组托时托条码对应物料与需要组托的条码对应物料要一致(Y为需一致)
                string sMaterialCtl = "Y";          //组托物料是否一致控制(Y为控制)
                string sSourceBillTypeCtl = "Y";    //未入库条码进行组托时,进行同源单类型控制(Y为控制)
                string sSourceBillNoCtl = "Y";      //未入库条码进行组托时,进行同源单控制(Y为控制)
                sMaterialCtl = oSystemParameter.omodel.Sc_PackUnionBill_MaterialCtl.ToUpper();
@@ -8196,7 +8304,7 @@
                string HIPAddress = "";                         //IP
                string HModCaption = "WMS-拆箱(拆托)模块";    //模块名
                ds = oCn.RunProcReturn("exec h_p_Sc_PackUnionBill_Delete_New " + HInterID.ToString() + ",'" + HBillNo + "','" + HBarCode_Pack + "','" + HMaker + "','" + ComputerName + "','" + HIPAddress + "','" + HModCaption + "'", "h_p_Sc_PackUnionBill_Delete_New");
                objJsonResult.code = "0";
                objJsonResult.count = 1;
                objJsonResult.Message = "成功";
@@ -8767,7 +8875,8 @@
            try
            {
                ds = oCn.RunProcReturn("select * from Gy_BarCodeBill where HBarcode='" + HBarCode + "'", "Gy_BarCodeBill");
                if (ds.Tables[0].Rows.Count == 0) {
                if (ds.Tables[0].Rows.Count == 0)
                {
                    DAL.ClsGy_BarCodeBill_View dal = new DAL.ClsGy_BarCodeBill_View();
                    string sErrMsg = "";
                    oSystemParameter.ShowBill(ref sErrMsg);
@@ -9562,7 +9671,7 @@
                try
                {
                    ds = oCn.RunProcReturn("exec h_p_WMS_AddBarCode_WorkShop " + HInterID.ToString() + ",'" + HBillNo + "','" + HBillType + "','" + HBarCode + "'," + HQty.ToString() + ",'" + HSourceBillType + "'," + HWhID.ToString() + "," + HSPID.ToString() + ",'" + HCarBarCode + "'," + HStockOrgID.ToString() + ",'" + HMaker + "'," + DBUtility.ClsPub.BoolToString(SourceFlag) + ",'" + sBatchNoCtl + "','" + sMustQtyCtl + "'", "h_p_WMS_AddBarCode_WorkShop");
                    ds = oCn.RunProcReturn("exec h_p_WMS_AddBarCode_WorkShop_TestByLLJ " + HInterID.ToString() + ",'" + HBillNo + "','" + HBillType + "','" + HBarCode + "'," + HQty.ToString() + ",'" + HSourceBillType + "'," + HWhID.ToString() + "," + HSPID.ToString() + ",'" + HCarBarCode + "'," + HStockOrgID.ToString() + ",'" + HMaker + "'," + DBUtility.ClsPub.BoolToString(SourceFlag) + ",'" + sBatchNoCtl + "','" + sMustQtyCtl + "'", "h_p_WMS_AddBarCode_WorkShop");
                    if (ds == null || ds.Tables[0].Rows.Count == 0)
                    {
                        objJsonResult.code = "0";
@@ -9598,14 +9707,14 @@
                }
            }
            else
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "获取系统参数失败! " + sErrMsg;
                    objJsonResult.data = null;
                    return objJsonResult;
                }
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "获取系统参数失败! " + sErrMsg;
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
@@ -9669,7 +9778,7 @@
        public object MaterialLowerBill_MaterInv(long HInterID, string HBillNo, string HBillType, Int64 HStockOrgID)
        {
            try
            {
            {
                ds = oCn.RunProcReturn("exec h_p_Kf_MaterialInventory " + HInterID + "," + HBillType + "," + HStockOrgID, "h_p_Kf_MaterialInventory");
                if (ds == null || ds.Tables[0].Rows.Count == 0)
                {
@@ -9716,7 +9825,7 @@
        {
            try
            {
                ds = oCn.RunProcReturn("select * from h_v_Gy_MouldIsUsed where å°è½¦æ¡ç ='" + HCarBarCode + "'" , "h_v_Gy_MouldIsUsed");
                ds = oCn.RunProcReturn("select * from h_v_Gy_MouldIsUsed where å°è½¦æ¡ç ='" + HCarBarCode + "'", "h_v_Gy_MouldIsUsed");
                if (ds == null || ds.Tables[0].Rows.Count == 0)
                {
                    objJsonResult.code = "0";
@@ -9810,12 +9919,12 @@
        /// <returns></returns>
        [Route("WEBSController/GetGy_BarCodeBill_QiaoYi_PDA_Json")]
        [HttpGet]
        public object GetGy_BarCodeBill_QiaoYi_PDA_Json(string sBarCode, string sBarCodeOutDate, string sCustomerName, string sSellOutBillNo)
        public object GetGy_BarCodeBill_QiaoYi_PDA_Json(string sBarCode)
        {
            try
            {
                //ds = oCn.RunProcReturn("exec h_p_Gy_BarCodeBillList_QiaoYi '" + sBarCode+ "'", "h_p_Gy_BarCodeBillList_QiaoYi");
                ds = oCn.RunProcReturn("exec h_p_Gy_BarCodeBillList_QiaoYi2 '" + sBarCode + "','" + sBarCodeOutDate + "','" + sCustomerName + "','" + sSellOutBillNo + "'", "h_p_Gy_BarCodeBillList_QiaoYi2");
                ds = oCn.RunProcReturn("exec h_p_Gy_BarCodeBillList_QiaoYi '" + sBarCode + "'", "h_p_Gy_BarCodeBillList_QiaoYi");
                //ds = oCn.RunProcReturn("exec h_p_Gy_BarCodeBillList_QiaoYi2 '" + sBarCode + "','" + sBarCodeOutDate + "','" + sCustomerName + "','" + sSellOutBillNo + "'", "h_p_Gy_BarCodeBillList_QiaoYi2");
                if (ds == null || ds.Tables[0].Rows.Count == 0)
                {
                    objJsonResult.code = "0";
@@ -10015,14 +10124,14 @@
            try
            {
                ds = oCn.RunProcReturn("exec h_p_MES_ProcessExchangeBillList_APP_HaiCheng " +
                    "@HBillNo = N'" + HBillNo + "', " +
                    "@HNumber = N'" + HNumber + "', " +
                    "@HName = N'" + HName + "', "  +
                    "@HBillNo = N'" + HBillNo + "', " +
                    "@HNumber = N'" + HNumber + "', " +
                    "@HName = N'" + HName + "', " +
                    "@HICMOBillNo = N'" + HICMOBillNo + "'," +
                    "@HProcID = N'" + HProcID + "', " +
                    "@HDeptID = N'" + HDeptID + "'"
                    , "h_p_MES_ProcessExchangeBillList_PDA_QiaoYi");
                if((bool)ds.Tables[1].Rows[0]["returntype"] == false)
                if ((bool)ds.Tables[1].Rows[0]["returntype"] == false)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
@@ -10037,7 +10146,8 @@
                    objJsonResult.Message = "当前所输入过滤条件,没有返回任何结果!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }else
                }
                else
                {
                    List<object> columnNameList = new List<object>();
                    //添加列名
@@ -10077,7 +10187,7 @@
        {
            try
            {
                ds = oCn.RunProcReturn("exec h_p_MES_ProcessExchangeSubBillList_PDA_QiaoYi '" + HInterID+ "'", "h_p_MES_ProcessExchangeSubBillList_PDA_QiaoYi");
                ds = oCn.RunProcReturn("exec h_p_MES_ProcessExchangeSubBillList_PDA_QiaoYi '" + HInterID + "'", "h_p_MES_ProcessExchangeSubBillList_PDA_QiaoYi");
                if (ds == null || ds.Tables[0].Rows.Count == 0)
                {
                    objJsonResult.code = "0";
@@ -10199,7 +10309,7 @@
                        string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
                        columnNameList.Add(JsonConvert.DeserializeObject(ColmString));  //获取到DataColumn列对象的列名
                    }
                   if (HDATA=="HSPE")
                    if (HDATA == "HSPE")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
@@ -10208,7 +10318,7 @@
                        objJsonResult.list = columnNameList;
                        return objJsonResult;
                    }
                   else if (HDATA == "HICM")
                    else if (HDATA == "HICM")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
@@ -10217,7 +10327,7 @@
                        objJsonResult.list = columnNameList;
                        return objJsonResult;
                    }
                   else
                    else
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
@@ -10714,13 +10824,13 @@
                    columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//获取到DataColumn列对象的列名
                }
                objJsonResult.code = "1";
                objJsonResult.count = 1;
                objJsonResult.Message = "Sucess!";
                objJsonResult.data = ds.Tables[0];
                objJsonResult.list = columnNameList;
                return objJsonResult;
                return objJsonResult;
            }
            catch (Exception e)
            {
@@ -10740,7 +10850,7 @@
        /// <returns></returns>
        [Route("WEBSController/UpdateKf_ICInvBal")]
        [HttpGet]
        public object UpdateKf_ICInvBal( )
        public object UpdateKf_ICInvBal()
        {
            try
            {
@@ -10776,7 +10886,7 @@
            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)
@@ -10954,7 +11064,7 @@
                    "and HMaker = '" + HMaker + "' " +
                    "and HOrgID = " + HStockOrgID;
                DataSet ds = oCn.RunProcReturn(sql, "Gy_getCusBarCodeBillMain");
                if(ds!=null && ds.Tables[0].Rows.Count > 0)
                if (ds != null && ds.Tables[0].Rows.Count > 0)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
@@ -11005,7 +11115,7 @@
        /// <returns></returns>
        [Route("WEBSController/Gy_getCusBarCodeBill_rushBarCode")]
        [HttpGet]
        public object Gy_getCusBarCodeBill_rushBarCode(Int64 HInterID, string HBillNo, string HBillType, string HBarCode, string HMaker, Int64 HStockOrgID,string HBarCode_Pre)
        public object Gy_getCusBarCodeBill_rushBarCode(Int64 HInterID, string HBillNo, string HBillType, string HBarCode, string HMaker, Int64 HStockOrgID, string HBarCode_Pre)
        {
            DataSet ds;
            try
@@ -11192,7 +11302,7 @@
        [HttpGet]
        public object Gy_getCusBarCodeBill_submitRushedBarCodeList(Int64 HInterID, string HBillNo, string HBillType, string HMaker, Int64 HStockOrgID)
        {
            DataSet ds;
            try
            {
@@ -11371,7 +11481,7 @@
                    return objJsonResult;
                }
                //=============================================================================================================================================
                //开启事务
                oCn.BeginTran();
@@ -11721,7 +11831,7 @@
            {
                string sql = "exec h_p_Gy_BarCodeConfirmBill_rushBarCode " + HInterID + ",'" + HBillNo + "','" + HBillType + "','" + HMaker + "'," + HStockOrgID + ",'" + HBarCode + "'";
                ds = oCn.RunProcReturn(sql, "h_p_Gy_BarCodeConfirmBill_rushBarCode");
                if(ds==null || ds.Tables[0].Rows.Count == 0)
                if (ds == null || ds.Tables[0].Rows.Count == 0)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
@@ -12198,7 +12308,7 @@
        #region æ£®æ¥·å…¶ä»–入库扫码
        public string Kf_OtherInBill_SK(string sBarCode,string HCustom1)
        public string Kf_OtherInBill_SK(string sBarCode, string HCustom1)
        {
            string HReturnResult;
            SQLHelper.ClsCN oCn = new SQLHelper.ClsCN();
@@ -12251,7 +12361,8 @@
                                //生产返修申请
                                model.Add("FBillTypeID", new JObject() { ["FNumber"] = "SCRKSQ004" }); //单据类型
                            }
                            else {
                            else
                            {
                                //标准生产入库申请单
                                model.Add("FBillTypeID", new JObject() { ["FNumber"] = "SCRUSQD" }); //单据类型
                            }
@@ -12421,7 +12532,7 @@
                                            return "发生异常,入库申请单单号:" + ",审核失败" + result2;
                                        }
                                    }
                                }
                                }
                            }
                        }
@@ -12439,7 +12550,7 @@
                        //获取入库申请单单据号
                        string HBillNo = DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["FBILLNO"]);
                        //包装线生成的生产入库申请单参与自动审核
                        if (HBillNo.Substring(0,2) == "RK" )
                        if (HBillNo.Substring(0, 2) == "RK")
                        {
                            //获取入库申请单单据状态
                            string HBillStatus = DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["FDOCUMENTSTATUS"]);
@@ -12506,7 +12617,7 @@
                            //执行更新语句
                            oCn.RunProc(sql);
                        }
                    }
                }
@@ -12520,5 +12631,104 @@
            return HReturnResult;
        }
        #endregion
        #region ç»‘定小车仓库仓位
        /// <summary>
        /// ç»‘定小车仓库仓位
        /// </summary>
        /// <returns></returns>
        [Route("WEBSController/BindCarAndWH")]
        [HttpGet]
        public object BindCarAndWH( string HMaker, Int64 HWhID, Int64 HSPID, string HCarBarCode, Int64 HStockOrgID)
        {
            try
            {
                ds = oCn.RunProcReturn("exec h_p_bindingCarintoWh "  + HWhID.ToString() + "," + HSPID.ToString() + ",'" + HCarBarCode + "','" + HMaker+ "'," + HStockOrgID.ToString(), "h_p_bindingCarintoWh");
                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
        //转移模块
        [Route("WEBSController/CheckHW")]
        [HttpGet]
        public object CheckHW(int  HWhID,int HSPID,int HWhID2,int HSPID2,string HBarCode,string HCarBarCode1,string HCarBarCode2,string UserID)
        {
            try
            {
                if (HCarBarCode1 == null) HCarBarCode1 = "";
                if (HCarBarCode2 == null) HCarBarCode2 = "";
                string sql = $"exec Transfer_Operation {HWhID},{HSPID},{HWhID2},{HSPID2},'{HBarCode}','{HCarBarCode1}','{HCarBarCode2}','{UserID}'";
                ds = oCn.RunProcReturn(sql, "Transfer_Operation");
                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;
            }
        }
    }
}