dytyqx
2026-03-30 85384dd5eaa81be10caeaea5fc827c9e6f7495f7
WebAPI/Controllers/ÎïÁ÷¹ÜÀí/³öÔ˵¥/WLYayBillController.cs
@@ -428,11 +428,11 @@
                return objJsonResult;
            }
            DataSet ds = oCN.RunProcReturn("select * from WL_YayBillMain a inner join WL_YayBillSub_Material b on b.HInterID=a.HInterID where a.HInterID=" + HInterID + " and b.HEntryID = " + HEntryID, "WL_YayBillMain");
            DataSet ds = oCN.RunProcReturn("select * from WL_YayBillMain where HInterID=" +HInterID  , "WL_YayBillMain");
            if (ds != null || ds.Tables[0].Rows.Count > 0)
            {
                oCN.BeginTran();
                oCN.RunProc("update WL_YayBillSub_Material set HScatteredVolume= " + ScatteredVolume + " where HInterID=" + HInterID + "and HEntryID=" + HEntryID);
                oCN.RunProc("update WL_YayBillMain set HScatteredVolume= " + ScatteredVolume + " where HInterID=" + HInterID );
                oCN.Commit();
                objJsonResult.code = "1";
@@ -553,11 +553,15 @@
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                if (IsAudit == 1)
                {
                    ds = oCN.RunProcReturn("select * from gy_car where  HItemID=" + HcheckID + "", "gy_car");
                    var HNumber = ds.Tables[0].Rows[0]["HNumber"].ToString();
                    var HName = ds.Tables[0].Rows[0]["HName"].ToString();
                    oCN.BeginTran();
                    oCN.RunProc("update WL_YayBillMain set HCarID='" + HcheckID + "' where HInterID=" + HInterID);
                    oCN.RunProc("update WL_YayBillMain set HCarID='" + HcheckID + "', CarHNumber='" + HNumber + "', CarHName='" + HName + "' where HInterID=" + HInterID);
                    oCN.Commit();
                    objJsonResult.code = "1";
@@ -569,8 +573,11 @@
                else
                {
                    ds = oCN.RunProcReturn("select * from Gy_Driver where  HItemID=" + HcheckID + "", "Gy_Driver");
                    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 + "',HDate_AllocationDriver=getdate()  where HInterID=" + HInterID);
                    oCN.RunProc("update WL_YayBillMain set HDriverID='" + HcheckID + "', DriverHName='" + HName + "', DriverHIDCard='" + HIDCard + "' where HInterID=" + HInterID);
                    oCN.Commit();
                    objJsonResult.code = "1";
@@ -579,6 +586,74 @@
                    objJsonResult.data = null;
                    return objJsonResult;
                }
            }
            catch (Exception e)
            {
                oCN.RollBack();
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "失败!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        #region å‡ºè¿å• ç»´æŠ¤å¸æœº(平台)
        [Route("WLYayBillController/selectDriver1")]
        [HttpGet]
        public object selectDriver1(string CarHNumber, string CarHName,string DriverHName,string DriverHIDCard, string CurUserName, int HInterID)
        {
            try
            {
                //if (!DBUtility.ClsPub.Security_Log("WLYayBill_SelectDriver1", 1, false, CurUserName))
                //{
                //    objJsonResult.code = "0";
                //    objJsonResult.count = 0;
                //    objJsonResult.Message = "无查看权限!";
                //    objJsonResult.data = null;
                //    return objJsonResult;
                //}
                DataSet ds = oCN.RunProcReturn("select * from WL_YayBillMain where HInterID=" + HInterID, "WL_YayBillMain");
                if (ds == null || ds.Tables[0].Rows.Count == 0)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "获取单据信息失败,单据不存在,无法进行分配车辆、司机操作!!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                if (DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HChecker"]) == "")
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "单据未审核,无法进行分配车辆、司机操作!!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                if (ds.Tables[0].Rows[0]["HDate_CarrierSure"] == null)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "单据未进行供应商确认。请先进行供应商确认,然后再进行分配车辆、司机操作!!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                    oCN.BeginTran();
                    oCN.RunProc("update WL_YayBillMain set CarHNumber='" + CarHNumber + "', CarHName='" + CarHName + "', DriverHName='" + DriverHName + "', DriverHIDCard='" + DriverHIDCard + "',HDate_AllocationDriver=getdate() where HInterID=" + HInterID);
                    oCN.Commit();
                    objJsonResult.code = "1";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "成功";
                    objJsonResult.data = null;
                    return objJsonResult;
            }
            catch (Exception e)
            {
@@ -637,7 +712,7 @@
                        return objJsonResult;
                    }
                    if (ds.Tables[0].Rows[0]["HDate_AllocationDriver"] == null || ds.Tables[0].Rows[0]["HDriverID"].ToString() == "0" || ds.Tables[0].Rows[0]["HCarID"].ToString() == "0")
                    if (ds.Tables[0].Rows[0]["HDate_AllocationDriver"] == null || ds.Tables[0].Rows[0]["CarHName"].ToString() == "0" || ds.Tables[0].Rows[0]["DriverHName"].ToString() == "0")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;