yusijie
2025-12-24 d8f1deab016ddea759a24deb9209177b0d35b4f7
WebAPI/Controllers/ÌõÂë¹ÜÀí/WEBSController.cs
@@ -8118,11 +8118,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)
@@ -13158,11 +13154,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";
@@ -13362,18 +13358,58 @@
        #endregion
        #region æ£€éªŒå• æ‰«ææºå• æ ¹æ®å•据类型 æºå•类型 æºå•号 è§£æžå¹¶è¿”回检验项目
        [Route("WEBSController/get_BillBarCode_Json_CheckItem")]
        [Route("WEBSController/get_CheckBillBarCode_Json_CheckItem")]
        [HttpGet]
        public Object get_BillBarCode_Json_CheckItem(int HBillType, int HSourceBillType, string HSourceBillNo)
        public Object get_CheckBillBarCode_Json_CheckItem(int HBillType, int HSourceBillType, string HBarCode, string HInterID, string HEntryID, int Mode)
        {
            try
            {
                // Mode = 1 è¡¨ç¤º æ‰«ç æ¨¡å¼ Mode = 2 è¡¨ç¤º é€‰å•模式
                if(Mode == 1)
                {
                    //扫码模式需要解析条码获取HInterID和HEntryID
                    ds = oCn.RunProcReturn($@"
                    exec h_p_CheckBillBarCode_AnalysisBarcode
                        @HBillType={HBillType},
                        @HSourceBillType={HSourceBillType},
                        @HBarCode={HBarCode}
                    ", "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 = null;
                objJsonResult.data = ds.Tables[0];
                return objJsonResult;
            }
@@ -13387,5 +13423,52 @@
            }
        }
        #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
    }
}