llj
2025-10-24 2ab0b15b314b5bc15ff723cc201e3545817987ca
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
@@ -381,12 +425,50 @@
            {
                Int64 HWhID = 0;
                HWhID = DBUtility.ClsPub.isLong(HBarCode.Replace("HWH", ""));
                ds = oCn.RunProcReturn("select HItemID,HNumber,HName,HSPFlag from Gy_Warehouse with(nolock) where HStopflag=0 and HItemID=" + HWhID.ToString() + " and HUSEORGID = " + HStockOrgID.ToString(), "Gy_Warehouse");
                ds = oCn.RunProcReturn("exec h_p_Gy_Warehouse_PDA " + HWhID.ToString() + "," + HStockOrgID.ToString(), "h_p_Gy_Warehouse_PDA");
                if (ds == null || ds.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 = ds.Tables[0];
                    return objJsonResult;
                }
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "返回仓库信息失败!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        /// <summary>
        /// èŽ·å–PDA仓库列表信息
        /// </summary>
        /// <returns></returns>
        [Route("WEBSController/GetWarehouseList_Json")]
        [HttpGet]
        public object GetWarehouseList_Json(string Warehouse, Int64 HStockOrgID)
        {
            try
            {
                ds = oCn.RunProcReturn("exec h_p_Gy_WarehouseList_PDA '" + Warehouse + "'," + HStockOrgID.ToString(), "h_p_Gy_WarehouseList_PDA");
                if (ds == null || ds.Tables[0].Rows.Count == 0)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "没有返回任何仓库记录!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
@@ -432,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)
@@ -636,6 +718,44 @@
                    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;
                }
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "返回部门信息失败!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        /// <summary>
        /// èŽ·å–éƒ¨é—¨åˆ—è¡¨ä¿¡æ¯
        /// </summary>
        /// <returns></returns>
        [Route("WEBSController/GetDepartmentList_Json")]
        [HttpGet]
        public object GetDepartmentList_Json(string Department, Int64 HStockOrgID)
        {
            try
            {
                ds = oCn.RunProcReturn("select HItemID,HNumber,HName from Gy_Department with(nolock) where HStopflag=0 and HUSEORGID=" + HStockOrgID.ToString() + " and (HNumber like '%" + Department + "%' or HName like '%" + Department + "%')", "Gy_Department");
                if (ds == null || ds.Tables[0].Rows.Count == 0)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "没有返回任何部门记录!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
@@ -952,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
                {
@@ -1529,7 +1649,7 @@
                try
                {
                    if(sFIFOCtl == "Y")
                    if (sFIFOCtl == "Y")
                    {
                        //更新先进先出临时表状态
                        oCn.RunProc("EXEC h_p_WMS_UPDateICInventory_FIFO_Tmp " + HInterID.ToString() + ",'" + HBillType + "'");
@@ -1952,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";
@@ -2473,6 +2593,7 @@
                websLsmain.HInterID = lsmain[0].HInterID;
                websLsmain.HBillNo = lsmain[0].HBillNo;
                websLsmain.HBillType = "1202";
                websLsmain.HMaker = lsmain[0].HMaker;
                websLsmain.HSTOCKORGID = lsmain[0].HSTOCKORGID;
                if (oWebs.set_SaveProductInBill_BillCheck(websLsmain, ref DBUtility.ClsPub.sErrInfo))
@@ -2614,6 +2735,7 @@
                websLsmain.HInterID = lsmain[0].HInterID;
                websLsmain.HBillNo = lsmain[0].HBillNo;
                websLsmain.HBillType = "1201";
                websLsmain.HMaker = lsmain[0].HMaker;
                websLsmain.HSTOCKORGID = lsmain[0].HSTOCKORGID;
                if (oWebs.set_SavePOStockInBill_BillCheck(websLsmain, ref DBUtility.ClsPub.sErrInfo))
@@ -2773,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 = "入库申请单";
                }
@@ -2839,6 +2961,7 @@
                websLsmain.HInterID = lsmain[0].HInterID;
                websLsmain.HBillNo = lsmain[0].HBillNo;
                websLsmain.HBillType = "1203";
                websLsmain.HMaker = lsmain[0].HMaker;
                websLsmain.HSTOCKORGID = lsmain[0].HSTOCKORGID;
                if (oWebs.set_SaveOtherInBill_BillCheck(websLsmain, ref DBUtility.ClsPub.sErrInfo))
@@ -2935,7 +3058,7 @@
                websLsmain.HSTOCKORGID = lsmain[0].HSTOCKORGID;
                websLsmain.HOWNERID = lsmain[0].HSTOCKORGID;
                if(sSourceType== "3710")
                if (sSourceType == "3710")
                {
                    sSourceType = "3720";
                }
@@ -2993,6 +3116,7 @@
                websLsmain.HInterID = lsmain[0].HInterID;
                websLsmain.HBillNo = lsmain[0].HBillNo;
                websLsmain.HBillType = "1204";
                websLsmain.HMaker = lsmain[0].HMaker;
                websLsmain.HSTOCKORGID = lsmain[0].HSTOCKORGID;
                if (oWebs.set_SaveMateOutBill_BillCheck(websLsmain, ref DBUtility.ClsPub.sErrInfo))
@@ -3233,6 +3357,7 @@
                websLsmain.HInterID = lsmain[0].HInterID;
                websLsmain.HBillNo = lsmain[0].HBillNo;
                websLsmain.HBillType = "1205";
                websLsmain.HMaker = lsmain[0].HMaker;
                websLsmain.HSTOCKORGID = lsmain[0].HSTOCKORGID;
                if (oWebs.set_SaveSellOutBill_BillCheck(websLsmain, ref DBUtility.ClsPub.sErrInfo))
@@ -3317,7 +3442,7 @@
                websLsmain.HSTOCKORGID = lsmain[0].HSTOCKORGID;
                websLsmain.HOWNERID = lsmain[0].HSTOCKORGID;
                if (oWebs.set_SaveEntrustOutBill_New(websLsmain, sSourceType, ref DBUtility.ClsPub.sErrInfo))
                {
@@ -3372,6 +3497,7 @@
                websLsmain.HInterID = lsmain[0].HInterID;
                websLsmain.HBillNo = lsmain[0].HBillNo;
                websLsmain.HBillType = "1211";
                websLsmain.HMaker = lsmain[0].HMaker;
                websLsmain.HSTOCKORGID = lsmain[0].HSTOCKORGID;
                if (oWebs.set_SaveEntrustOutBill_BillCheck(websLsmain, ref DBUtility.ClsPub.sErrInfo))
@@ -3510,6 +3636,7 @@
                websLsmain.HInterID = lsmain[0].HInterID;
                websLsmain.HBillNo = lsmain[0].HBillNo;
                websLsmain.HBillType = "1206";
                websLsmain.HMaker = lsmain[0].HMaker;
                websLsmain.HSTOCKORGID = lsmain[0].HSTOCKORGID;
                if (oWebs.set_SaveOtherOutBill_BillCheck(websLsmain, ref DBUtility.ClsPub.sErrInfo))
@@ -3647,6 +3774,7 @@
                websLsmain.HInterID = lsmain[0].HInterID;
                websLsmain.HBillNo = lsmain[0].HBillNo;
                websLsmain.HBillType = "1254";
                websLsmain.HMaker = lsmain[0].HMaker;
                websLsmain.HSTOCKORGID = lsmain[0].HSTOCKORGID;
                if (oWebs.set_SaveMateReplenishOutBill_BillCheck(websLsmain, ref DBUtility.ClsPub.sErrInfo))
@@ -3706,6 +3834,7 @@
                websLsmain.HInterID = lsmain[0].HInterID;
                websLsmain.HBillNo = lsmain[0].HBillNo;
                websLsmain.HBillType = "1255";
                websLsmain.HMaker = lsmain[0].HMaker;
                websLsmain.HSTOCKORGID = lsmain[0].HSTOCKORGID;
                if (oWebs.set_SaveEntrustReplenishOutBill_BillCheck(websLsmain, ref DBUtility.ClsPub.sErrInfo))
@@ -3751,13 +3880,144 @@
        [HttpPost]
        public object set_SaveMoveStockBill_Json([FromBody] JObject oMain)
        {
            //获取系统参数
            string sErrMsg = "";
            if (oSystemParameter.ShowBill(ref sErrMsg) == true)
            {
                var _value = oMain["oMain"].ToString();
                string msg1 = _value.ToString();
                try
                {
                    List<Model.ClsKf_MoveStockBillMain> lsmain = new List<Model.ClsKf_MoveStockBillMain>();
                    ListModels oListModels = new ListModels();
                    lsmain = oListModels.getMoveStockBillMainByJson(msg1);
                    WebS.ClsKf_MoveStockBillMain websLsmain = new WebS.ClsKf_MoveStockBillMain();
                    string sSourceType = lsmain[0].HMainSourceBillType;
                    websLsmain.HInterID = lsmain[0].HInterID;
                    websLsmain.HBillNo = lsmain[0].HBillNo;
                    websLsmain.HBillType = lsmain[0].HBillType;
                    websLsmain.HDate = lsmain[0].HDate;
                    websLsmain.HDeptID = lsmain[0].HDeptID;
                    websLsmain.HWHID = lsmain[0].HWHID;
                    websLsmain.HSCWHID = lsmain[0].HSCWHID;
                    if (oSystemParameter.omodel.WMS_CampanyName == "小卫") //系统参数  å®¢æˆ·å®šåˆ¶åŒ–名称     ç©ºç™½ä¸ºé€šç”¨
                    {
                        websLsmain.HSupID = lsmain[0].HCusID;
                    }
                    else
                    {
                        websLsmain.HSupID = lsmain[0].HSupID;
                    }
                    websLsmain.HKeeperID = lsmain[0].HKeeperID;
                    websLsmain.HSecManagerID = lsmain[0].HSecManagerID;
                    websLsmain.HEmpID = lsmain[0].HEmpID;
                    websLsmain.HManagerID = lsmain[0].HManagerID;
                    websLsmain.HRemark = lsmain[0].HRemark;
                    websLsmain.HExplanation = lsmain[0].HExplanation;
                    websLsmain.HInnerBillNo = lsmain[0].HInnerBillNo;
                    websLsmain.HRedBlueFlag = lsmain[0].HRedBlueFlag;
                    websLsmain.HBillSubType = lsmain[0].HBillSubType;
                    websLsmain.HStockStyle = lsmain[0].HStockStyle;
                    websLsmain.HTransferDirect = lsmain[0].HTransferDirect;
                    websLsmain.HShipType = lsmain[0].HShipType;
                    if (lsmain[0].HMainSourceBillType == "1402")
                    {
                        websLsmain.HMainSourceBillType = "发货通知单";
                    }
                    else if (lsmain[0].HMainSourceBillType == "1243")
                    {
                        websLsmain.HMainSourceBillType = "调拨申请单";
                    }
                    else if (lsmain[0].HMainSourceBillType == "3720")
                    {
                        websLsmain.HMainSourceBillType = "生产用料清单";
                    }
                    else if (lsmain[0].HMainSourceBillType == "1604")
                    {
                        websLsmain.HMainSourceBillType = "委外用料清单";
                    }
                    else if (lsmain[0].HMainSourceBillType == "1214")
                    {
                        websLsmain.HMainSourceBillType = "生产发料通知单";
                    }
                    else if (lsmain[0].HMainSourceBillType == "3721")
                    {
                        websLsmain.HMainSourceBillType = "生产备料单";
                    }
                    else if (lsmain[0].HMainSourceBillType == "1242")
                    {
                        websLsmain.HMainSourceBillType = "出库申请单";
                    }
                    else
                    {
                        websLsmain.HMainSourceBillType = "手工录入";
                    }
                    websLsmain.HMaker = lsmain[0].HMaker;
                    websLsmain.HBillerID = lsmain[0].HBillerID;
                    websLsmain.HStockInOrgID = lsmain[0].HStockInOrgID;
                    websLsmain.HStockOutOrgID = lsmain[0].HStockOutOrgID;
                    websLsmain.HSTOCKORGID = lsmain[0].HStockOutOrgID;
                    websLsmain.HOWNERID = lsmain[0].HStockOutOrgID;
                    if (oWebs.set_SaveMoveStockBill(websLsmain, sSourceType, 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;
                }
            }
            else
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "获取系统参数失败! " + sErrMsg;
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        #region ç›´æŽ¥è°ƒæ‹¨å…æ‰«ç‰©æ–™æ¡ç     æ–°å¢žæ¨¡å¼
        /// <summary>
        /// ç›´æŽ¥è°ƒæ‹¨æ–°å¢žä¸Šä¼ 
        /// </summary>
        /// <returns></returns>
        [Route("WEBSController/set_SaveMoveStockBill_AutoBarCode_Json")]
        [HttpPost]
        public object set_SaveMoveStockBill_AutoBarCode_Json([FromBody] JObject oMain)
        {
            var _value = oMain["oMain"].ToString();
            string msg1 = _value.ToString();
            string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries);
            string sMainStr = sArray[0].ToString();         //主表数据
            string sSubStr = sArray[1].ToString();          //子表数据
            try
            {
                //主表赋值
                List<Model.ClsKf_MoveStockBillMain> lsmain = new List<Model.ClsKf_MoveStockBillMain>();
                ListModels oListModels = new ListModels();
                lsmain = oListModels.getMoveStockBillMainByJson(msg1);
                lsmain = oListModels.getMoveStockBillMainByJson(sMainStr);
                WebS.ClsKf_MoveStockBillMain websLsmain = new WebS.ClsKf_MoveStockBillMain();
                string sSourceType = lsmain[0].HMainSourceBillType;
                websLsmain.HInterID = lsmain[0].HInterID;
@@ -3780,33 +4040,9 @@
                websLsmain.HStockStyle = lsmain[0].HStockStyle;
                websLsmain.HTransferDirect = lsmain[0].HTransferDirect;
                websLsmain.HShipType = lsmain[0].HShipType;
                if (lsmain[0].HMainSourceBillType == "1402")
                {
                    websLsmain.HMainSourceBillType = "发货通知单";
                }
                else if (lsmain[0].HMainSourceBillType == "1243")
                {
                    websLsmain.HMainSourceBillType = "调拨申请单";
                }
                else if (lsmain[0].HMainSourceBillType == "3720")
                if (lsmain[0].HMainSourceBillType == "3720")
                {
                    websLsmain.HMainSourceBillType = "生产用料清单";
                }
                else if (lsmain[0].HMainSourceBillType == "1604")
                {
                    websLsmain.HMainSourceBillType = "委外用料清单";
                }
                else if (lsmain[0].HMainSourceBillType == "1214")
                {
                    websLsmain.HMainSourceBillType = "生产发料通知单";
                }
                else if (lsmain[0].HMainSourceBillType == "3721")
                {
                    websLsmain.HMainSourceBillType = "生产备料单";
                }
                else if (lsmain[0].HMainSourceBillType == "1242")
                {
                    websLsmain.HMainSourceBillType = "出库申请单";
                }
                else
                {
@@ -3819,21 +4055,55 @@
                websLsmain.HSTOCKORGID = lsmain[0].HStockOutOrgID;
                websLsmain.HOWNERID = lsmain[0].HStockOutOrgID;
                if (oWebs.set_SaveMoveStockBill(websLsmain, sSourceType, ref DBUtility.ClsPub.sErrInfo))
                //子表赋值
                sSubStr = sSubStr.Replace("\\", "");
                sSubStr = sSubStr.Replace("\n", "");
                List<Models.ClsKf_ICStockBillSub> sub = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Models.ClsKf_ICStockBillSub>>(sSubStr);
                foreach (var item in sub)
                {
                    //数量与源单数量不一致时,更新条码出入库临时表 HQty å­—段值
                    if (item.HQty != item.HQtyMust)
                    {
                        oCn.RunProc("Update KF_PonderationBillMain_Temp set HQty2=" + item.HQty.ToString() + " where HInterID= " + websLsmain.HInterID.ToString() + " and HBillType='" + websLsmain.HBillType + "' and HSourceInterID= " + item.HSourceInterID.ToString() + " and HSourceEntryID= " + item.HSourceEntryID.ToString());
                    }
                }
                ds = oCn.RunProcReturn("exec h_p_WMS_AutoBarCode_MoveStockBill " + websLsmain.HInterID.ToString() + ",'" + websLsmain.HBillType + "'," + websLsmain.HWHID.ToString() + ",0," + websLsmain.HSCWHID.ToString() + ",0", "h_p_WMS_AutoBarCode_MoveStockBill");
                if (ds == null || ds.Tables[0].Rows.Count == 0)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 1;
                    objJsonResult.Message = DBUtility.ClsPub.sErrInfo;  //成功!
                    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 = 0;
                    objJsonResult.Message = DBUtility.ClsPub.sErrInfo;  //失败!
                    objJsonResult.data = null;
                    return objJsonResult;
                    if (oWebs.set_SaveMoveStockBill(websLsmain, sSourceType, 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)
@@ -3872,6 +4142,7 @@
                websLsmain.HInterID = lsmain[0].HInterID;
                websLsmain.HBillNo = lsmain[0].HBillNo;
                websLsmain.HBillType = "1207";
                websLsmain.HMaker = lsmain[0].HMaker;
                websLsmain.HSTOCKORGID = lsmain[0].HSTOCKORGID;
                if (oWebs.set_SaveMoveStockBill_BillCheck(websLsmain, ref DBUtility.ClsPub.sErrInfo))
@@ -4166,6 +4437,10 @@
                {
                    websLsmain.HMainSourceBillType = "退料通知单";
                }
                else if (lsmain[0].HMainSourceBillType == "1201")
                {
                    websLsmain.HMainSourceBillType = "采购入库单";
                }
                else
                {
                    websLsmain.HMainSourceBillType = "手工录入";
@@ -4247,6 +4522,10 @@
                if (lsmain[0].HMainSourceBillType == "3720")
                {
                    websLsmain.HMainSourceBillType = "生产用料清单";
                }
                else if (lsmain[0].HMainSourceBillType == "1204")
                {
                    websLsmain.HMainSourceBillType = "生产领料单";
                }
                else
                {
@@ -4793,7 +5072,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";
@@ -4835,7 +5114,7 @@
                bool bResult;
                if (OperationType == "1")
                {
                    bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo);
                    bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo);
                }
                else
                {
@@ -5104,7 +5383,7 @@
            {
                if (oSystemParameter.omodel.WMS_CloudMode.ToUpper() == "N") //系统参数是否为私有云模式,N为公有云模式,Y为私有云模式
                {
                    if(HSourceBillType == "1214")
                    if (HSourceBillType == "1214")
                    {
                        //重新同步生产发料通知单
                        Kf_MateOutRequestBillController obill = new Kf_MateOutRequestBillController();
@@ -5349,6 +5628,52 @@
                    objJsonResult.count = 1;
                    objJsonResult.Message = "成功";
                    objJsonResult.data = WebSoBar;
                    return objJsonResult;
                }
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "扫描源单条码失败!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        /// <summary>
        /// ç›´æŽ¥è°ƒæ‹¨å…æ‰«ç‰©æ–™æ¡ç æ¨¡å—    æ‰«ææºå•条码  20250818
        /// </summary>
        /// <returns></returns>
        [Route("WEBSController/get_SourceBarCode_MoveStock_AutoBarCode_Json")]
        [HttpGet]
        public object get_SourceBarCode_MoveStock_AutoBarCode_Json(Int64 HInterID, string HBillNo, string HBillType, string HSourceBillNo, string HSourceBillType, string HMaker, Int64 HOWNERID)
        {
            try
            {
                ds = oCn.RunProcReturn("exec h_p_WMS_AddSourceBarCode_MoveStock_AutoBarCode " + HInterID.ToString() + ",'" + HBillNo + "','" + HBillType + "','" + HSourceBillNo + "','" + HSourceBillType + "','" + HMaker + "'," + HOWNERID.ToString(), "h_p_WMS_AddSourceBarCode_MoveStock_AutoBarCode");
                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;
                }
            }
@@ -5635,7 +5960,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);
@@ -5690,7 +6015,7 @@
                objJsonResult.data = null;
                return objJsonResult;
            }
         }
        }
        #endregion
@@ -5770,7 +6095,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
@@ -6490,8 +6815,8 @@
                    objJsonResult.Message = "校验模式,扫描条码失败!" + e.ToString();
                    objJsonResult.data = null;
                    return objJsonResult;
                    }
                }
            }
            else
            {
                objJsonResult.code = "0";
@@ -6676,7 +7001,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")
@@ -7319,15 +7644,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
@@ -7347,13 +7721,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;
                }
@@ -7361,8 +7742,8 @@
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "成功";
                    objJsonResult.data = WebSoBarModel;
                    objJsonResult.Message = "成功!";
                    objJsonResult.data = ds.Tables[0];
                    return objJsonResult;
                }
            }
@@ -7483,7 +7864,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();
@@ -7943,7 +8324,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 = "成功";
@@ -8514,7 +8895,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);
@@ -9309,7 +9691,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";
@@ -9345,14 +9727,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
@@ -9416,7 +9798,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)
                {
@@ -9463,7 +9845,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";
@@ -9557,11 +9939,12 @@
        /// <returns></returns>
        [Route("WEBSController/GetGy_BarCodeBill_QiaoYi_PDA_Json")]
        [HttpGet]
        public object GetGy_BarCodeBill_QiaoYi_PDA_Json(string sWhere)
        public object GetGy_BarCodeBill_QiaoYi_PDA_Json(string sBarCode)
        {
            try
            {
                ds = oCn.RunProcReturn("exec h_p_Gy_BarCodeBillList_QiaoYi '" + sWhere+ "'", "h_p_Gy_BarCodeBillList_QiaoYi");
                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";
@@ -9749,6 +10132,70 @@
        }
        #endregion
        #region [根据单据号 ç‰©æ–™ç¼–码 ç‰©æ–™åç§° ç”Ÿäº§è®¢å• å·¥åº éƒ¨é—¨èŽ·å– å·¥åºæµè½¬å¡]
        /// <summary>
        /// èŽ·å–æ¡ç ä¿¡æ¯ æ·»åŠ å·¥åº éƒ¨é—¨æŸ¥è¯¢æ¡ä»¶
        /// </summary>
        /// <returns></returns>
        [Route("WEBSController/GetMES_ProcessExchangeBillList_APP_HaiCheng")]
        [HttpGet]
        public object GetMES_ProcessExchangeBillList_APP_HaiCheng(string HBillNo, string HNumber, string HName, string HICMOBillNo, string user, string HProcID, string HDeptID)
        {
            try
            {
                ds = oCn.RunProcReturn("exec h_p_MES_ProcessExchangeBillList_APP_HaiCheng " +
                    "@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)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = ds.Tables[1].Rows[0]["mesg"].ToString();
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                else if (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>
        /// æŸ¥çœ‹æ˜Žç»†
@@ -9760,7 +10207,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";
@@ -9882,7 +10329,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;
@@ -9891,7 +10338,7 @@
                        objJsonResult.list = columnNameList;
                        return objJsonResult;
                    }
                   else if (HDATA == "HICM")
                    else if (HDATA == "HICM")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
@@ -9900,7 +10347,7 @@
                        objJsonResult.list = columnNameList;
                        return objJsonResult;
                    }
                   else
                    else
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
@@ -10397,13 +10844,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)
            {
@@ -10423,7 +10870,7 @@
        /// <returns></returns>
        [Route("WEBSController/UpdateKf_ICInvBal")]
        [HttpGet]
        public object UpdateKf_ICInvBal( )
        public object UpdateKf_ICInvBal()
        {
            try
            {
@@ -10459,7 +10906,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)
@@ -10637,7 +11084,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;
@@ -10688,7 +11135,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
@@ -10875,7 +11322,7 @@
        [HttpGet]
        public object Gy_getCusBarCodeBill_submitRushedBarCodeList(Int64 HInterID, string HBillNo, string HBillType, string HMaker, Int64 HStockOrgID)
        {
            DataSet ds;
            try
            {
@@ -11054,7 +11501,7 @@
                    return objJsonResult;
                }
                //=============================================================================================================================================
                //开启事务
                oCn.BeginTran();
@@ -11404,7 +11851,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;
@@ -11881,7 +12328,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();
@@ -11934,7 +12381,8 @@
                                //生产返修申请
                                model.Add("FBillTypeID", new JObject() { ["FNumber"] = "SCRKSQ004" }); //单据类型
                            }
                            else {
                            else
                            {
                                //标准生产入库申请单
                                model.Add("FBillTypeID", new JObject() { ["FNumber"] = "SCRUSQD" }); //单据类型
                            }
@@ -12104,7 +12552,7 @@
                                            return "发生异常,入库申请单单号:" + ",审核失败" + result2;
                                        }
                                    }
                                }
                                }
                            }
                        }
@@ -12122,7 +12570,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"]);
@@ -12189,7 +12637,7 @@
                            //执行更新语句
                            oCn.RunProc(sql);
                        }
                    }
                }
@@ -12203,5 +12651,168 @@
            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;
            }
        }
        #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)
        {
            try
            {
                WebSoBar = null;
                // 1. æŸ¥è¯¢é‡‘蝶云中 æ‰€æœ‰ç¬¦åˆçš„生产领料单和下游领料单
                ds = oCn.RunProcReturn($@"
                    select HBillNo, HChecker from h_v_Kf_MateOutBillList_K3 where HBillNo like '%{HBillNo}%'
                ", "h_v_Kf_MateOutBillList_K3");
                List<string> HBillNoList = new List<string>();
                foreach (DataRow row in ds.Tables[0].Rows)
                {
                    if (!string.IsNullOrWhiteSpace(row["HChecker"].ToString()))
                    {
                        // 2. åˆ¤æ–­å•据审核状态,查找未被审核的单据
                        WebSoBar = oWebs.get_BillBarCode_BillCheck(HBillNo, HBillType, HMaker, HStockOrgID, ref DBUtility.ClsPub.sErrInfo);
                        if (WebSoBar != null)
                        {
                            // 3. èŽ·å–åˆ°ç¬¦åˆæ¡ä»¶çš„è¿”å›žå€¼ï¼Œç«‹å³è¿”å›ž
                            objJsonResult.code = "0";
                            objJsonResult.count = 1;
                            objJsonResult.Message = "成功";
                            objJsonResult.data = WebSoBar;
                            return objJsonResult;
                        }
                    }
                }
                // 3. æ‰€æœ‰å•据都被审核,或者没有符合要求的单据,返回错误信息
                if (WebSoBar == null)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = DBUtility.ClsPub.sErrInfo;
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                else
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "成功";
                    objJsonResult.data = WebSoBar;
                    return objJsonResult;
                }
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "扫描单据条码失败!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
    }
}