1
wtt
2025-05-26 cab9c912a2a4ea3e45c1e8d1507efd5fa5fda4ac
WebAPI/Controllers/»ù´¡×ÊÁÏ/»ù´¡×ÊÁÏ/Gy_SOPBillEditController.cs
@@ -27,7 +27,9 @@
        public DAL.ClsGy_SOPBill BillOld = new DAL.ClsGy_SOPBill();
        public bool BillChange;   //
        public DataGridView grdMain = new System.Windows.Forms.DataGridView();
        ClsGridViewSum oSumGrid = new ClsGridViewSum();
        ClsGridViewSum oSumGrid = new ClsGridViewSum();
        //获取系统参数
        Pub_Class.ClsXt_SystemParameter oSystemParameter = new Pub_Class.ClsXt_SystemParameter();
        //定义
        public const Int16 HTagCol = 0;
@@ -256,6 +258,7 @@
                string msgSub = sArray[1].ToString(); //表体信息
                string OperationType = sArray[2].ToString(); //操作类型
                string user = sArray[3].ToString(); //用户
                DBUtility.ClsPub.CurUserName = user;
                ListModels oListModels = new ListModels();
                DAL.ClsGy_SOPBill oBill = new DAL.ClsGy_SOPBill();
@@ -375,12 +378,23 @@
        [HttpPost]
        public object UploadFile1()
        {
            string path="";
            string HBillNo = HttpContext.Current.Request.Params["HBillNo"];  //单据号
            string HUserName = HttpContext.Current.Request.Params["HUserName"];  //创建人
            string HInterID = HttpContext.Current.Request.Params["HInterID"];  //单据内码
            HttpPostedFile files = HttpContext.Current.Request.Files["file"]; //文件
            string path = HttpContext.Current.Server.MapPath("~/../Files/SOP/" + HBillNo);
            string Ret = "";
            if (oSystemParameter.ShowBill(ref Ret))
            {
                if (oSystemParameter.omodel.WMS_CampanyName == "杭州斯莫尔")
                {
                    path = "D:/网站发布/MES/MES测试/LAYUI/Files/SOP/" + HBillNo;
                }
                else
                {
                    path = HttpContext.Current.Server.MapPath("~/../Files/SOP/" + HBillNo);
                }
            }
            //string path = @"D:\\Files\\"+ HBillNo;
            Int64 HEntryID = Convert.ToInt64(HttpContext.Current.Request.Params["HEntryID"]);  //子内码
            dynamic dyResult = UpLoadFile(files, path, HBillNo, HInterID, HUserName, HEntryID);
@@ -456,7 +470,20 @@
                {
                    File.Delete(fileurl);      //删除指定文件
                    files.SaveAs(fileurl);
                    string StrPath = "/files/SOP/" + HBillNo + "/" + filename;
                    string StrPath = "";
                    string Ret = "";
                    if (oSystemParameter.ShowBill(ref Ret))
                    {
                        if (oSystemParameter.omodel.WMS_CampanyName == "杭州斯莫尔")
                        {
                            StrPath = "D:/网站发布/MES/MES测试/LAYUI/Files/SOP/" + HBillNo + "/" + filename;
                        }
                        else
                        {
                            StrPath = "/files/SOP/" + HBillNo + "/" + filename;
                        }
                    }
                    if (File.Exists(fileurl))
                    {
                        //这里可以执行一些其它的操作,比如更新数据库
@@ -476,8 +503,22 @@
                else
                {
                    Directory.CreateDirectory(fileSavePath); //添加文件夹
                    files.SaveAs(fileurl);
                    string StrPath = "/files/SOP/" + HBillNo + "/" + filename;
                    files.SaveAs(fileurl);
                    string StrPath = "";
                    string Ret = "";
                    //if (oSystemParameter.ShowBill(ref Ret))
                    //{
                    //    if (oSystemParameter.omodel.WMS_CampanyName == "杭州斯莫尔")
                    //    {
                    //        StrPath = "D:/网站发布/MES/MES测试/LAYUI/Files/SOP/" + HBillNo + "/" + filename;
                    //    }
                    //    else
                    //    {
                    //        StrPath = "/files/SOP/" + HBillNo + "/" + filename;
                    //    }
                    //}
                    StrPath = "/files/SOP/" + HBillNo + "/" + filename;
                    if (File.Exists(fileurl))
                    {
                        //这里可以执行一些其它的操作,比如更新数据库