1
wtt
2026-02-06 daa95fd4d96d0bc7ceb0308005c78f4bfd0fd005
WebAPI/Controllers/ÌõÂë¹ÜÀí/WEBSController.cs
@@ -5014,6 +5014,66 @@
        #endregion
        #region å§”外退料    ä¸Šä¼ ç”Ÿå•
        #region å§”外退料    æ ¡éªŒæ¨¡å¼
        /// <summary>
        /// å§”外退料校验上传
        /// </summary>
        /// <returns></returns>
        [Route("WEBSController/set_SaveEntrustOutBackBill_BillCheck_Json")]
        [HttpPost]
        public object set_SaveEntrustOutBackBill_BillCheck_Json([FromBody] JObject oMain)
        {
            var _value = oMain["oMain"].ToString();
            string msg1 = _value.ToString();
            try
            {
                List<Model.ClsKf_ICStockBillMain> lsmain = new List<Model.ClsKf_ICStockBillMain>();
                ListModels oListModels = new ListModels();
                lsmain = oListModels.getICStockBillMainByJson(msg1);
                WebAPI.WebS.ClsKf_ICStockBillMain websLsmain = new WebS.ClsKf_ICStockBillMain();
                websLsmain.HInterID = lsmain[0].HInterID;
                websLsmain.HBillNo = lsmain[0].HBillNo;
                websLsmain.HBillType = "1238";
                websLsmain.HMaker = lsmain[0].HMaker;
                websLsmain.HSTOCKORGID = lsmain[0].HSTOCKORGID;
                if (oWebs.set_SaveEntrustOutBackBill_BillCheck(websLsmain, ref DBUtility.ClsPub.sErrInfo))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 1;
                    objJsonResult.Message = DBUtility.ClsPub.sErrInfo;  //成功!
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                else
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = DBUtility.ClsPub.sErrInfo;  //失败!
                    objJsonResult.data = null;
                    return objJsonResult;
                }
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "委外退料校验失败!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        #endregion
        #region ç”Ÿäº§ç»„托单    ä¸Šä¼ ç”Ÿå•
        /// <summary>
@@ -9066,6 +9126,29 @@
        #endregion
        #endregion
        #region æ ¹æ®sn码寻找对应的中箱码
        [Route("WEBSController/getMiddleCodeBySn")]
        [HttpGet]
        public object getMiddleCodeBySn(string HBarCode,int HStockOrgID)
        {
            DataSet dss = oCn.RunProcReturn("select * from Gy_CaseCodeRelation where HBarCode='"+ HBarCode + "'", "Gy_CaseCodeRelation");
            if (dss.Tables[0].Rows[0]["HCaseCode"].ToString() == "" || dss == null)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "未找到sn码所对应的中箱码";
                objJsonResult.data = null;
                return objJsonResult;
            }
            objJsonResult.code = "1";
            objJsonResult.count = 1;
            objJsonResult.Message = "成功";
            objJsonResult.data = dss.Tables[0];
            return objJsonResult;
        }
        #endregion
        #endregion
@@ -13830,19 +13913,27 @@
        {
            try
            {
                string sErrMsg = "";
                oSystemParameter.ShowBill(ref sErrMsg);
                // åŽèˆŸå®¢æˆ·
                if(oSystemParameter.omodel.WMS_CampanyName == "华舟")
                {
                    HBarCode = HBarCode.Split('-')[0];
                }
                // Mode = 1 è¡¨ç¤º æ‰«ç æ¨¡å¼ Mode = 2 è¡¨ç¤º é€‰å•模式
                if(Mode == 1)
                if (Mode == 1)
                {
                    //扫码模式需要解析条码获取HInterID和HEntryID
                    ds = oCn.RunProcReturn($@"
                    exec h_p_CheckBillBarCode_AnalysisBarcode 
                        @HBillType={HBillType},
                        @HSourceBillType={HSourceBillType},
                        @HBarCode={HBarCode},
                        @HBarCode='{HBarCode}',
                        @user = '{user}'
                    ", "h_p_CheckBillBarCode_AnalysisBarcode");
                    if (ds.Tables[0].Rows.Count == 0)
                    if (ds is null || ds.Tables[0].Rows.Count == 0)
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
@@ -13945,7 +14036,7 @@
        {
            try
            {
                ds = oCn.RunProcReturn("select * from GetMaterMesByCarBarCode where å°è½¦='" + CarBarCode.ToString() + "'" , "GetMaterMesByCarBarCode");
                ds = oCn.RunProcReturn("select * from GetMaterMesByCarBarCode where HQty>=0 and å°è½¦='" + CarBarCode.ToString() + "'" , "GetMaterMesByCarBarCode");
                if (ds == null || ds.Tables[0].Rows.Count == 0)
                {
                    objJsonResult.code = "0";
@@ -13982,5 +14073,45 @@
            }
        }
        #endregion
        #region [取样单] èŽ·å–æœªä¸‹æŽ¨æˆæ£€éªŒå•çš„å–æ ·å•åˆ—è¡¨
        [Route("WEBSController/AwaitCheckSampleBillList")]
        [HttpGet]
        public Object AwaitCheckSampleBillList(string user)
        {
            List<object> columnNameList = new List<object>();
            try
            {
                ds = oCn.RunProcReturn($@"
                    exec h_p_AwaitCheckSampleBillList @user={user}
                ", "h_p_CheckBillBarCode_CheckItem");
                //添加列名
                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 = "1";
                objJsonResult.count = 1;
                objJsonResult.Message = "success!";
                objJsonResult.data = ds.Tables;
                objJsonResult.list = columnNameList;
                return objJsonResult;
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "扫描单据条码失败!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
    }
}