wangyi
2026-04-01 0a110b2ae33b36d11f4a09f503e62ae5f0e64451
WebAPI/Controllers/ÎïÁ÷¹ÜÀí/³öÔ˵¥/WLYayBillController.cs
@@ -577,7 +577,7 @@
                    var HName = ds.Tables[0].Rows[0]["HName"].ToString();
                    var HIDCard = ds.Tables[0].Rows[0]["HIDCard"].ToString();
                    oCN.BeginTran();
                    oCN.RunProc("update WL_YayBillMain set HDriverID='" + HcheckID + "', DriverHName='" + HName + "', DriverHIDCard='" + HIDCard + "' where HInterID=" + HInterID);
                    oCN.RunProc("update WL_YayBillMain set HDriverID='" + HcheckID + "', DriverHName='" + HName + "', DriverHIDCard='" + HIDCard + "',HDate_AllocationDriver=getdate() where HInterID=" + HInterID);
                    oCN.Commit();
                    objJsonResult.code = "1";
@@ -816,9 +816,62 @@
        }
        #endregion
        #region å‡ºè¿å• èŽ·å–å­è¡¨æ•°æ®
        [Route("WLYayBillController/GetList")]
        [HttpGet]
        public object GetList(string hmainid_hsubid, string user)
        {
            try
            {
                List<object> columnNameList = new List<object>();
                if (!DBUtility.ClsPub.Security_Log("WLYayBill_Query", 1, false, user))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "无查看权限!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                string sql = $"select * from h_v_Gy_MaterialPackingRelation where hmainid_hsubid in (" + hmainid_hsubid + ")";
                // æ‰§è¡ŒæŸ¥è¯¢
                DataSet ds = oCN.RunProcReturn(sql, "WL_YayBillMain");
                //添加列名
                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 = "Sucess!";
                objJsonResult.data = ds.Tables[0];
                objJsonResult.list = columnNameList;
                return objJsonResult;
            }
            catch (Exception ex)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "没有返回任何记录!" + ex.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
    }
}