模具档案优化,增加附件上传功能,器具校准记录单增加附件上传功能
6个文件已修改
532 ■■■■ 已修改文件
WebAPI/Controllers/BaseSet/Gy_MaterialController.cs 267 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/Sc_MouldRepairInBillListController.cs 227 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/WebAPIController.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Models/Gy_Mould.cs 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Properties/PublishProfiles/FolderProfile8.pubxml.user 18 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/WebAPI.csproj.user 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/BaseSet/Gy_MaterialController.cs
@@ -2584,11 +2584,8 @@
            }
        }
        #endregion
        /// <summary>
        /// 新增模具档案-保存按钮
        ///参数:string sql。
        ///返回值:object。
        /// </summary>
        #region[器具档案保存与修改保存方法]
        [Route("Gy_Mould_Edit/AddBill")]
        [HttpPost]
        public object AddBill([FromBody] JObject oMain)
@@ -2702,6 +2699,16 @@
                int HMouldHeight = mainList[0].HMouldHeight;          //高
                int HMouldFoldHeight = mainList[0].HMouldFoldHeight;  //折叠高度
                int HUserID = mainList[0].HUserID;  // 使用人(Gy_Employee)
                string HBrand = mainList[0].HBrand;  // 品牌
                string HCalibrationType = mainList[0].HCalibrationType;  // 校准类型 (内/外校)
                string HLocation = mainList[0].HLocation;  // 位置
                DateTime HCalibrationDate = mainList[0].HCalibrationDate;  // 校准日期
                string HCalibrationCycle = mainList[0].HCalibrationCycle;  // 校准周期
                string HProductDesignSize = mainList[0].HProductDesignSize;  // 产品设计尺寸
                string HGaugeDesignSize = mainList[0].HGaugeDesignSize;  // 检具设计尺寸
                int HProductQTY = mainList[0].HProductQTY;  // 产品数量
                //保存前控制=========================================
                string HBillNote = "";
                ds = oCN.RunProcReturn("Exec h_p_Gy_MouldFileMain_BeforeSaveCtrl " + HInterID.ToString() + ", '" + HBillNo + "','" + HBillNote + "',1 ", "h_p_Gy_MouldFileMain_BeforeSaveCtrl");
@@ -2737,19 +2744,21 @@
                ",HBomID,HVersion,HSPGroupID,HSPID,HDesignLife,HNowSupID,HNowSupTypeID" +
                ",HUseLife,HLeaveLife,HProdQty,HProdWeight,HMouldOWNER,HSaveLife,HMouldDotCheckRuleInterID,HMouldMaintainRuleInterID,HBarCode,HMadeSupID" +
                ",HMouldClass,HNowWHID,HNowSPID,HInitLife,HMouldUseStatus,HCREATEORGID,HUSEORGID " +
                 ",HMouldLength,HMouldWidth,HMouldHeight,HMouldFoldHeight,HTransPackFlag,HSendPackFlag ) " +
                 ",HMouldLength,HMouldWidth,HMouldHeight,HMouldFoldHeight,HTransPackFlag,HSendPackFlag," +
                 "HUserID,HBrand,HCalibrationType,HLocation,HCalibrationDate,HCalibrationCycle,HProductDesignSize,HGaugeDesignSize,HProductQTY ) " +
               " values('" + BillType + "','" + BillType + "'," + HInterID + ",'" + HBillNo + "','" + HDate + "'" +
                        "," + HYear + "," + HPeriod + ",'" + HRemark + "','" + HMaker + "',getdate()" +
                        ",'" + HMouldNo + "','" + HName + "','" + HModel + "','" + HModel2 + "','" + HDiameter + "'" +
                        ",'" + HSubjoin + "','" + HSubjoin2 + "','" + HPICNo + "','" + HWorkMaterModel + "'" +
                        "," + HMaterID + ",'" + HMaterNumber + "'," + HMouleTypeID + "," + HUnitID +
                        ",'" + HOutComDate + "','" + HOutComNo + "'," + HDeptID + "," + HSupID + ",'" + HSupNumber + "'" +
                        "," + HPrintQty + ",'" + HMouldStatus + "'," + HWHID + "," + HRoutingID + "," + HCaveQty +
                        "," + HBOMID + ",'" + HVersion + "'," + HSPGroupID + "," + HSPID + ",'" + HDesignLife + "','" + HNowSupID + "','" + HNowSupTypeID + "'" +
                        ",'" + HUseLife + "','" + HLeaveLife + "','" + HProdQty + "','" + HProdWeight + "','" + HMouldOWNER + "','" + HSaveLife + "','" + HMouldDotCheckRuleInterID + "','" + HMouldMaintainRuleInterID + "','" + HBarCode + "'," + HMadeSupID +
                        ",'" + HMouldClass + "'," + HNowWHID + "," + HNowSPID + ",'" + HInitLife + "','" + HMouldUseStatus + "'," + HCREATEORGID + "," + HUSEORGID +
                        "," + HMouldLength + "," + HMouldWidth + "," + HMouldHeight + "," + HMouldFoldHeight + "," + Convert.ToString(HTransPackFlag ? 1 : 0) + "," + Convert.ToString(HSendPackFlag ? 1 : 0) + ") ");
                "," + HYear + "," + HPeriod + ",'" + HRemark + "','" + HMaker + "',getdate()" +
                ",'" + HMouldNo + "','" + HName + "','" + HModel + "','" + HModel2 + "','" + HDiameter + "'" +
                ",'" + HSubjoin + "','" + HSubjoin2 + "','" + HPICNo + "','" + HWorkMaterModel + "'" +
                "," + HMaterID + ",'" + HMaterNumber + "'," + HMouleTypeID + "," + HUnitID +
                ",'" + HOutComDate + "','" + HOutComNo + "'," + HDeptID + "," + HSupID + ",'" + HSupNumber + "'" +
                "," + HPrintQty + ",'" + HMouldStatus + "'," + HWHID + "," + HRoutingID + "," + HCaveQty +
                "," + HBOMID + ",'" + HVersion + "'," + HSPGroupID + "," + HSPID + ",'" + HDesignLife + "','" + HNowSupID + "','" + HNowSupTypeID + "'" +
                ",'" + HUseLife + "','" + HLeaveLife + "','" + HProdQty + "','" + HProdWeight + "','" + HMouldOWNER + "','" + HSaveLife + "','" + HMouldDotCheckRuleInterID + "','" + HMouldMaintainRuleInterID + "','" + HBarCode + "'," + HMadeSupID +
                ",'" + HMouldClass + "'," + HNowWHID + "," + HNowSPID + ",'" + HInitLife + "','" + HMouldUseStatus + "'," + HCREATEORGID + "," + HUSEORGID +
                "," + HMouldLength + "," + HMouldWidth + "," + HMouldHeight + "," + HMouldFoldHeight + "," + Convert.ToString(HTransPackFlag ? 1 : 0) + "," + Convert.ToString(HSendPackFlag ? 1 : 0) + "," +
                "'" + HUserID + "','" + HBrand + "','" + HCalibrationType + "','" + HLocation + "','" + HCalibrationDate + "','" + HCalibrationCycle + "','" + HProductDesignSize + "','" + HGaugeDesignSize + "','" + HProductQTY + "') ");
                //子表
                oCN.RunProc("Insert into Gy_MouldFileSub " +
@@ -2796,6 +2805,7 @@
                objJsonResult.code = "1";
                objJsonResult.count = 1;
                objJsonResult.HInterID = HInterID.ToString();
                objJsonResult.Message = null;
                objJsonResult.data = null;
                return objJsonResult;
@@ -2811,12 +2821,6 @@
            }
        }
        /// <summary>
        /// 修改单据-保存按钮
        ///参数:string sql。
        ///返回值:object。
        /// </summary>
        [Route("Gy_Mould_Edit/AddBill1")]
        [HttpPost]
        public object AddBill1([FromBody] JObject oMain)
@@ -2908,6 +2912,18 @@
                int HMouldWidth = mainList[0].HMouldWidth;            //宽
                int HMouldHeight = mainList[0].HMouldHeight;          //高
                int HMouldFoldHeight = mainList[0].HMouldFoldHeight;  //折叠高度
                int HUserID = mainList[0].HUserID;  // 使用人(Gy_Employee)
                string HBrand = mainList[0].HBrand;  // 品牌
                string HCalibrationType = mainList[0].HCalibrationType;  // 校准类型 (内/外校)
                string HLocation = mainList[0].HLocation;  // 位置
                DateTime HCalibrationDate = mainList[0].HCalibrationDate;  // 校准日期
                string HCalibrationCycle = mainList[0].HCalibrationCycle;  // 校准周期
                string HProductDesignSize = mainList[0].HProductDesignSize;  // 产品设计尺寸
                string HGaugeDesignSize = mainList[0].HGaugeDesignSize;  // 检具设计尺寸
                int HProductQTY = mainList[0].HProductQTY;  // 产品数量
                //若MAINDI重复则重新获取
                oCN.BeginTran();
@@ -2996,12 +3012,16 @@
                 ",HInitLife='" + HInitLife +
                 "',HNextMainDate='" + HNextMainDate +
                 "',HMouldUseStatus='" + HMouldUseStatus +
                  "' where HInterID=" + HInterID.ToString());
                //修改子项目代码
                //oCN.RunProc("exec h_p_Gy_UpdateNumber Gy_Department,'" + HNumber + ".','" + this.HOldNumber + ".'", ref DBUtility.ClsPub.sExeReturnInfo);
                //将上级 为非末级
                // oCN.RunProc("Update Gy_Department set HEndflag=0 where HItemID=" + HInterID, ref DBUtility.ClsPub.sExeReturnInfo);
                 "',HUserID='" + HUserID +
                 "',HBrand='" + HBrand +
                 "',HCalibrationType='" + HCalibrationType +
                 "',HLocation='" + HLocation +
                 "',HCalibrationDate='" + HCalibrationDate +
                 "',HCalibrationCycle='" + HCalibrationCycle +
                 "',HProductDesignSize='" + HProductDesignSize +
                 "',HGaugeDesignSize='" + HGaugeDesignSize +
                 "',HProductQTY='" + HProductQTY +
                 "' where HInterID=" + HInterID.ToString());
                oCN.RunProc("delete from Gy_MouldFileSub_SubMater where HInterID='" + HInterID + "'");
                oCN.RunProc("delete from Gy_MouldFileSub_MaintainRule where HInterID='" + HInterID + "'");
@@ -3035,7 +3055,7 @@
                objJsonResult.code = "1";
                objJsonResult.count = 1;
                objJsonResult.Message = "修改单据成功!";
                //objJsonResult.data = null;
                objJsonResult.HInterID = HInterID.ToString();
                return objJsonResult;
            }
            catch (Exception e)
@@ -3130,11 +3150,9 @@
            return objJsonResult;
        }
        /// <summary>
        /// 磨具档案修改按钮方法-计算下次保养/校正日期-获取档案最近一次的保养记录
        ///参数:string sql。
        ///返回值:object。
        /// </summary>
        #endregion
        #region [模具档案修改按钮方法-计算下次保养/校正日期-获取档案最近一次的保养记录]
        [Route("Gy_Mould_Edit/calculateHNextMainDate")]
        [HttpGet]
        public object calculateHNextMainDate(long HInterID)
@@ -3164,6 +3182,8 @@
                return objJsonResult;
            }
        }
        #endregion
        /// <summary>
        /// 磨具档案修改按钮方法
@@ -4896,6 +4916,185 @@
        #endregion
        #endregion
        #region 器具档案 文件上传
        [Route("Gy_MouldFileBIllMain/UploadFile_Gy_MouldFilen")]
        [HttpPost]
        public object UploadFile_Gy_MouldFilen()
        {
            string HBillNo = HttpContext.Current.Request.Params["HBillNo"];  //单据号
            string HRemark = HttpContext.Current.Request.Params["HRemark"];  //备注
            string HUserName = HttpContext.Current.Request.Params["HUserName"];  //创建人
            HttpPostedFile files = HttpContext.Current.Request.Files["file"];
            string path = HttpContext.Current.Server.MapPath("~/../Files/Gy_MouldFilen/" + HBillNo);
            dynamic dyResult = UploadFile_Gy_MouldFilen(files, path, HBillNo, HRemark, HUserName);
            if (dyResult != null && dyResult.result == 1)
            {
                objJsonResult.code = "1";
                objJsonResult.count = 1;
                objJsonResult.Message = "上传成功!";
                objJsonResult.data = null;
                return objJsonResult;
            }
            else
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = dyResult.returnval;
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        public dynamic UploadFile_Gy_MouldFilen(HttpPostedFile files, string path, string HBillNo, string HRemark, string HUserName)
        {
            dynamic Result_Ob = new { result = 1, returnval = "上传成功!" };
            string filePath = Path.GetFullPath(files.FileName);//文件上传路径
            string fileExtension = Path.GetExtension(files.FileName);// 文件扩展名
            string filename = files.FileName;//文件名
            string fileSavePath = path;// 上传保存路径
            int filesize = files.ContentLength;//获取上传文件的大小单位为字节byte
            int Maxsize = 40000 * 1024;//定义上传文件的最大空间大小为40M
            try
            {
                if (files == null || files.ContentLength <= 0)
                {
                    Result_Ob = new { result = 0, returnval = "文件不能为空!" };
                    return Result_Ob;
                }
                if (filesize >= Maxsize)
                {
                    Result_Ob = new { result = 0, returnval = "上传文件超过40M,不能上传!" };
                    return Result_Ob;
                }
                string fileurl = Path.Combine(fileSavePath, filename);
                if (Directory.Exists(fileurl) == true)  //如果存在重名文件就提示
                {
                    Result_Ob = new { result = 0, returnval = "存在同名文件!" };
                    return Result_Ob;
                }
                //删除数据表数据
                ds = oCN.RunProcReturn("delete from MES_AccessoriesList where HSourceBillNo ='" + HBillNo + "' and HFileName='" + filename + "'", "MES_AccessoriesList");
                if (Directory.Exists(path))
                {
                    File.Delete(fileurl);      //删除指定文件
                    files.SaveAs(fileurl);
                    string StrPath = "/files/Gy_MouldFilen/" + HBillNo + "/" + filename;
                    if (File.Exists(fileurl))
                    {
                        //这里可以执行一些其它的操作,比如更新数据库
                        //写入数据表
                        oCN.RunProc("Insert into MES_AccessoriesList (HFileName,HFilePath,HFilePath_Cus,HFileType" +
                                    ",HLoadMan,HLoadDate,HRemark,HVerNum,HFileSize" +
                                    ",HFileClsID,HSourceBillNo" +
                                   ") values('"
                                    + filename.ToString() + "','" + StrPath.ToString() + "','" + filePath.ToString() + "','" + fileExtension.ToString() + "'" +
                                    ",'" + HUserName + "',getdate(),'" + HRemark + "','V1','" + filesize +
                                    "','" + 0 + "','" + HBillNo +
                                   "') ");
                    }
                    else
                    {
                        Result_Ob = new { result = 0, returnval = "上传失败!此文件为恶意文件" };
                    }
                }
                else
                {
                    Directory.CreateDirectory(fileSavePath); //添加文件夹
                    files.SaveAs(fileurl);
                    string StrPath = "/files/Gy_MouldFilen/" + HBillNo + "/" + filename;
                    if (File.Exists(fileurl))
                    {
                        //这里可以执行一些其它的操作,比如更新数据库
                        //写入数据表
                        oCN.RunProc("Insert into MES_AccessoriesList (HFileName,HFilePath,HFilePath_Cus,HFileType" +
                                    ",HLoadMan,HLoadDate,HRemark,HVerNum,HFileSize" +
                                    ",HFileClsID,HSourceBillNo" +
                                   ") values('"
                                    + filename.ToString() + "','" + StrPath.ToString() + "','" + filePath.ToString() + "','" + fileExtension.ToString() + "'" +
                                    ",'" + HUserName + "',getdate(),'" + HRemark + "','V1','" + filesize +
                                    "','" + 0 + "','" + HBillNo +
                                   "') ");
                    }
                    else
                    {
                        Result_Ob = new { result = 0, returnval = "上传失败!此文件为恶意文件" };
                    }
                }
            }
            catch (Exception e)
            {
                Result_Ob = new { result = 0, returnval = e.Message };
            }
            return Result_Ob;
        }
        /// <summary>
        /// 根据单据号查找上传文件列表
        /// </summary>
        /// <param name="sWhere"></param>
        /// <returns></returns>
        [Route("Gy_MouldFileBIllMain/Gy_MouldFilen_Filelist")]
        [HttpGet]
        public object Gy_MouldFilen_Filelist(string HBillNo)
        {
            var url = fileip + "/Files/Gy_MouldFilen/" + HBillNo + "/";
            try
            {
                ds = oCN.RunProcReturn("select *,'" + url + "'+CAST(HFileName as varchar(200))as url  from MES_AccessoriesList where HSourceBillNo='" + HBillNo + "'", "MES_AccessoriesList");
                objJsonResult.code = "1";
                objJsonResult.count = 1;
                objJsonResult.Message = "Sucess!";
                objJsonResult.data = ds.Tables[0];
                return objJsonResult;
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "Exception!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        /// <summary>
        /// 根据ID,单据号,文件名 删除文件
        /// </summary>
        /// <param name="sWhere"></param>
        /// <returns></returns>
        [Route("Gy_MouldFileBIllMain/Gy_MouldFilen_DeleteFilelist")]
        [HttpGet]
        public object Gy_MouldFilen_DeleteFilelist(string HItemID, string HSourceBillNo, string HFileName)
        {
            try
            {
                oCN.RunProc("delete from MES_AccessoriesList where HItemID =" + HItemID);
                string fileurl = Path.Combine(HttpContext.Current.Server.MapPath("~/../Files/Gy_MouldFilen/" + HSourceBillNo), HFileName);
                File.Delete(fileurl);      //删除指定文件
                objJsonResult.code = "1";
                objJsonResult.count = 1;
                objJsonResult.Message = "删除成功!";
                objJsonResult.data = null;
                return objJsonResult;
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "Exception!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        //根据条码找物料信息
        [Route("Gy_Material/findMaterialByNumber")]
WebAPI/Controllers/Sc_MouldRepairInBillListController.cs
@@ -14756,7 +14756,7 @@
        #endregion
        #region 器具保养记录拍照上传
        [Route("Sc_MouldMaintainBill/UploadFile")]
        [Route("Sc_MouldMaintainBill/UploadFile_Maintain")]
        [HttpPost]
        public object UploadFile_Maintain()
        {
@@ -15511,56 +15511,20 @@
        }
        #endregion
        #region[编辑时获取表头数据]
        [Route("Gy_QCVerificationBillMain/Gy_QCVerificationBillMainCheckDetai")]
        #region[编辑时获取数据]
        [Route("Gy_QCVerificationBillMain/Gy_QCVerificationBillDetail")]
        [HttpGet]
        public ApiResult<DataSet> Gy_QCVerificationBillMainCheckDetai(string HID)
        public ApiResult<DataSet> Gy_QCVerificationBillDetail(string HID)
        {
            if (string.IsNullOrEmpty(HID))
                return new ApiResult<DataSet> { code = -1, msg = "ID不能为空" };
            SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
            var dataSet = oCN.RunProcReturn("select top 1 * from h_v_Gy_QCVerificationBillMain_Edit  where hmainid= " + HID + " ", "h_v_Gy_QCVerificationBillMain");
            var dataSet = oCN.RunProcReturn("select  * from h_v_Gy_QCVerificationBillMain_Edit  where hmainid= " + HID + " ", "h_v_Gy_QCVerificationBillMain_Edit");
            if (dataSet == null || dataSet.Tables[0].Rows.Count == 0)
                return new ApiResult<DataSet> { code = -1, msg = "不存在单号" };
            return new ApiResult<DataSet> { code = 1, msg = "查询成功", data = dataSet };
        }
        #endregion
        #region[编辑时获取表体数据]
        [Route("Gy_QCVerificationBillMain/SGy_QCVerificationBillMainListProjectDetai")]
        [HttpGet]
        public object SGy_QCVerificationBillMainListProjectDetai(string sqlWhere)
        {
            DataSet ds;
            List<object> list = new List<object>();
            try
            {
                SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
                string sql = "select HInspectInstruMentID,检验仪器代码 HInspectInstruMentNumber,检验仪器名称 HInspectInstruMentName,生效日期 HBeginDate,失效日期 HEndDate,校准状态 HHCalibrationStatus  from h_v_Gy_QCVerificationBillMain_Edit where 1 = 1 " + sqlWhere;
                ds = oCN.RunProcReturn(sql, "h_v_Gy_QCVerificationBillMain_Edit");
                list.Add(ds.Tables[0]);
                objJsonResult.code = "0";
                objJsonResult.count = 1;
                objJsonResult.Message = "获取信息成功!";
                objJsonResult.data = null;
                objJsonResult.list = list;
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "没有返回任何记录!" + e.ToString();
                objJsonResult.data = null;
            }
            return objJsonResult;
        }
        #endregion
        #endregion
        #region 器具校准记录单 保存/编辑
        
@@ -15671,6 +15635,185 @@
            }
        }
        #endregion
        #region 器具校准记录 文件上传
        [Route("Gy_QCVerificationBillMain/UploadFile_Gy_QCVerification")]
        [HttpPost]
        public object UploadFile_Gy_QCVerification()
        {
            string HBillNo = HttpContext.Current.Request.Params["HBillNo"];  //单据号
            string HRemark = HttpContext.Current.Request.Params["HRemark"];  //备注
            string HUserName = HttpContext.Current.Request.Params["HUserName"];  //创建人
            HttpPostedFile files = HttpContext.Current.Request.Files["file"];
            string path = HttpContext.Current.Server.MapPath("~/../Files/Gy_QCVerification/" + HBillNo);
            dynamic dyResult = UploadFile_Gy_QCVerification(files, path, HBillNo, HRemark, HUserName);
            if (dyResult != null && dyResult.result == 1)
            {
                objJsonResult.code = "1";
                objJsonResult.count = 1;
                objJsonResult.Message = "上传成功!";
                objJsonResult.data = null;
                return objJsonResult;
            }
            else
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = dyResult.returnval;
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        public dynamic UploadFile_Gy_QCVerification(HttpPostedFile files, string path, string HBillNo, string HRemark, string HUserName)
        {
            dynamic Result_Ob = new { result = 1, returnval = "上传成功!" };
            string filePath = Path.GetFullPath(files.FileName);//文件上传路径
            string fileExtension = Path.GetExtension(files.FileName);// 文件扩展名
            string filename = files.FileName;//文件名
            string fileSavePath = path;// 上传保存路径
            int filesize = files.ContentLength;//获取上传文件的大小单位为字节byte
            int Maxsize = 40000 * 1024;//定义上传文件的最大空间大小为40M
            try
            {
                if (files == null || files.ContentLength <= 0)
                {
                    Result_Ob = new { result = 0, returnval = "文件不能为空!" };
                    return Result_Ob;
                }
                if (filesize >= Maxsize)
                {
                    Result_Ob = new { result = 0, returnval = "上传文件超过40M,不能上传!" };
                    return Result_Ob;
                }
                string fileurl = Path.Combine(fileSavePath, filename);
                if (Directory.Exists(fileurl) == true)  //如果存在重名文件就提示
                {
                    Result_Ob = new { result = 0, returnval = "存在同名文件!" };
                    return Result_Ob;
                }
                //删除数据表数据
                ds = oCN.RunProcReturn("delete from MES_AccessoriesList where HSourceBillNo ='" + HBillNo + "' and HFileName='" + filename + "'", "MES_AccessoriesList");
                if (Directory.Exists(path))
                {
                    File.Delete(fileurl);      //删除指定文件
                    files.SaveAs(fileurl);
                    string StrPath = "/files/Gy_QCVerification/" + HBillNo + "/" + filename;
                    if (File.Exists(fileurl))
                    {
                        //这里可以执行一些其它的操作,比如更新数据库
                        //写入数据表
                        oCN.RunProc("Insert into MES_AccessoriesList (HFileName,HFilePath,HFilePath_Cus,HFileType" +
                                    ",HLoadMan,HLoadDate,HRemark,HVerNum,HFileSize" +
                                    ",HFileClsID,HSourceBillNo" +
                                   ") values('"
                                    + filename.ToString() + "','" + StrPath.ToString() + "','" + filePath.ToString() + "','" + fileExtension.ToString() + "'" +
                                    ",'" + HUserName + "',getdate(),'" + HRemark + "','V1','" + filesize +
                                    "','" + 0 + "','" + HBillNo +
                                   "') ");
                    }
                    else
                    {
                        Result_Ob = new { result = 0, returnval = "上传失败!此文件为恶意文件" };
                    }
                }
                else
                {
                    Directory.CreateDirectory(fileSavePath); //添加文件夹
                    files.SaveAs(fileurl);
                    string StrPath = "/files/Gy_QCVerification/" + HBillNo + "/" + filename;
                    if (File.Exists(fileurl))
                    {
                        //这里可以执行一些其它的操作,比如更新数据库
                        //写入数据表
                        oCN.RunProc("Insert into MES_AccessoriesList (HFileName,HFilePath,HFilePath_Cus,HFileType" +
                                    ",HLoadMan,HLoadDate,HRemark,HVerNum,HFileSize" +
                                    ",HFileClsID,HSourceBillNo" +
                                   ") values('"
                                    + filename.ToString() + "','" + StrPath.ToString() + "','" + filePath.ToString() + "','" + fileExtension.ToString() + "'" +
                                    ",'" + HUserName + "',getdate(),'" + HRemark + "','V1','" + filesize +
                                    "','" + 0 + "','" + HBillNo +
                                   "') ");
                    }
                    else
                    {
                        Result_Ob = new { result = 0, returnval = "上传失败!此文件为恶意文件" };
                    }
                }
            }
            catch (Exception e)
            {
                Result_Ob = new { result = 0, returnval = e.Message };
            }
            return Result_Ob;
        }
        /// <summary>
        /// 根据单据号查找上传文件列表
        /// </summary>
        /// <param name="sWhere"></param>
        /// <returns></returns>
        [Route("Gy_QCVerificationBillMain/Gy_QCVerification_Filelist")]
        [HttpGet]
        public object Gy_QCVerification_Filelist(string HBillNo)
        {
            var url = fileip + "/Files/Gy_QCVerification/" + HBillNo + "/";
            try
            {
                ds = oCN.RunProcReturn("select *,'" + url + "'+CAST(HFileName as varchar(200))as url  from MES_AccessoriesList where HSourceBillNo='" + HBillNo + "'", "MES_AccessoriesList");
                objJsonResult.code = "1";
                objJsonResult.count = 1;
                objJsonResult.Message = "Sucess!";
                objJsonResult.data = ds.Tables[0];
                return objJsonResult;
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "Exception!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        /// <summary>
        /// 根据ID,单据号,文件名 删除文件
        /// </summary>
        /// <param name="sWhere"></param>
        /// <returns></returns>
        [Route("Gy_QCVerificationBillMain/Gy_QCVerification_DeleteFilelist")]
        [HttpGet]
        public object Gy_QCVerification_DeleteFilelist(string HItemID, string HSourceBillNo, string HFileName)
        {
            try
            {
                oCN.RunProc("delete from MES_AccessoriesList where HItemID =" + HItemID);
                string fileurl = Path.Combine(HttpContext.Current.Server.MapPath("~/../Files/Gy_QCVerification/" + HSourceBillNo), HFileName);
                File.Delete(fileurl);      //删除指定文件
                objJsonResult.code = "1";
                objJsonResult.count = 1;
                objJsonResult.Message = "删除成功!";
                objJsonResult.data = null;
                return objJsonResult;
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "Exception!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        #endregion
WebAPI/Controllers/WebAPIController.cs
@@ -22415,7 +22415,7 @@
            {
                SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
                ds = oCN.RunProcReturn("Select * from Xt_BillType where HNumber = '" + HModuleType + "'", "Xt_BillType");
                ds = oCN.RunProcReturn("Select * from Xt_BillType  with(nolock) where HNumber = '" + HModuleType + "'", "Xt_BillType");
                if (ds == null || ds.Tables[0].Rows.Count <= 0)
                {
WebAPI/Models/Gy_Mould.cs
@@ -80,5 +80,16 @@
        public string HMouldUseStatus { get; set; }
        public DateTime HNextMainDate { get; set; }
        public int HUserID { get; set; }  // 使用人(Gy_Employee)
        public string HBrand { get; set; }  // 品牌
        public string HCalibrationType { get; set; }  // 校准类型 (内/外校)
        public string HLocation { get; set; }  // 位置
        public DateTime HCalibrationDate { get; set; }  // 校准日期
        public string HCalibrationCycle { get; set; }  // 校准周期
        public string HProductDesignSize { get; set; }  // 产品设计尺寸
        public string HGaugeDesignSize { get; set; }  // 检具设计尺寸
        public int HProductQTY { get; set; }  // 产品数量
    }
}
WebAPI/Properties/PublishProfiles/FolderProfile8.pubxml.user
@@ -5,7 +5,7 @@
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <PropertyGroup>
    <_PublishTargetUrl>D:\网站发布\智云MESWMS\API</_PublishTargetUrl>
    <History>True|2025-12-04T01:53:53.3381625Z;False|2025-12-04T09:51:54.1953606+08:00;True|2025-12-03T20:17:43.6822978+08:00;False|2025-12-03T20:17:13.6794411+08:00;True|2025-12-03T20:04:33.7080472+08:00;False|2025-12-03T20:03:18.9092172+08:00;True|2025-12-03T17:55:36.8190814+08:00;True|2025-12-03T17:31:16.1192761+08:00;False|2025-12-03T17:25:01.3978650+08:00;True|2025-12-03T17:12:24.4237446+08:00;True|2025-12-03T16:54:15.1801517+08:00;False|2025-12-03T16:53:42.7976484+08:00;True|2025-12-03T12:26:32.8151086+08:00;True|2025-12-03T10:22:12.3177261+08:00;False|2025-12-03T10:21:38.7919750+08:00;True|2025-12-03T10:18:00.9077028+08:00;True|2025-12-03T10:02:30.4022692+08:00;False|2025-12-03T09:58:15.6880929+08:00;True|2025-12-02T20:20:19.5577161+08:00;True|2025-12-02T19:59:44.5694165+08:00;True|2025-12-02T18:53:53.4696294+08:00;True|2025-12-02T12:31:02.0786003+08:00;False|2025-12-02T12:30:35.5116200+08:00;True|2025-12-02T09:16:07.2877709+08:00;True|2025-02-12T14:57:08.1380239+08:00;True|2025-02-12T14:47:58.0901509+08:00;True|2025-02-12T14:15:10.5288654+08:00;True|2025-02-12T14:12:22.5382196+08:00;True|2025-02-12T14:07:11.7831540+08:00;True|2024-11-29T13:29:48.1554947+08:00;</History>
    <History>True|2025-12-09T04:04:27.5887901Z;False|2025-12-09T12:02:37.2146599+08:00;True|2025-12-08T14:20:26.4878391+08:00;True|2025-12-08T12:37:30.4953352+08:00;True|2025-12-08T11:42:08.8772270+08:00;True|2025-12-08T11:38:52.8463177+08:00;True|2025-12-08T10:04:02.0917227+08:00;False|2025-12-08T10:03:46.8962836+08:00;True|2025-12-08T10:00:15.0547300+08:00;False|2025-12-08T09:58:28.7217278+08:00;True|2025-12-08T09:32:28.1251567+08:00;True|2025-12-08T09:29:41.3856966+08:00;False|2025-12-08T09:27:36.8951905+08:00;True|2025-12-05T16:39:06.2892731+08:00;True|2025-12-05T15:48:40.9542261+08:00;True|2025-12-05T14:08:26.7097242+08:00;False|2025-12-05T14:08:07.6105127+08:00;True|2025-12-05T12:59:40.2026457+08:00;True|2025-12-05T10:35:19.2246561+08:00;False|2025-12-05T10:32:23.4813105+08:00;True|2025-12-04T09:53:53.3381625+08:00;False|2025-12-04T09:51:54.1953606+08:00;True|2025-12-03T20:17:43.6822978+08:00;False|2025-12-03T20:17:13.6794411+08:00;True|2025-12-03T20:04:33.7080472+08:00;False|2025-12-03T20:03:18.9092172+08:00;True|2025-12-03T17:55:36.8190814+08:00;True|2025-12-03T17:31:16.1192761+08:00;False|2025-12-03T17:25:01.3978650+08:00;True|2025-12-03T17:12:24.4237446+08:00;True|2025-12-03T16:54:15.1801517+08:00;False|2025-12-03T16:53:42.7976484+08:00;True|2025-12-03T12:26:32.8151086+08:00;True|2025-12-03T10:22:12.3177261+08:00;False|2025-12-03T10:21:38.7919750+08:00;True|2025-12-03T10:18:00.9077028+08:00;True|2025-12-03T10:02:30.4022692+08:00;False|2025-12-03T09:58:15.6880929+08:00;True|2025-12-02T20:20:19.5577161+08:00;True|2025-12-02T19:59:44.5694165+08:00;True|2025-12-02T18:53:53.4696294+08:00;True|2025-12-02T12:31:02.0786003+08:00;False|2025-12-02T12:30:35.5116200+08:00;True|2025-12-02T09:16:07.2877709+08:00;True|2025-02-12T14:57:08.1380239+08:00;True|2025-02-12T14:47:58.0901509+08:00;True|2025-02-12T14:15:10.5288654+08:00;True|2025-02-12T14:12:22.5382196+08:00;True|2025-02-12T14:07:11.7831540+08:00;True|2024-11-29T13:29:48.1554947+08:00;</History>
  </PropertyGroup>
  <ItemGroup>
    <File Include="apiapp.json">
@@ -45,19 +45,19 @@
      <publishTime>02/22/2013 16:43:40</publishTime>
    </File>
    <File Include="bin/BLL.dll">
      <publishTime>12/03/2025 22:11:14</publishTime>
      <publishTime>12/08/2025 11:37:12</publishTime>
    </File>
    <File Include="bin/BLL.pdb">
      <publishTime>12/03/2025 22:11:14</publishTime>
      <publishTime>12/08/2025 11:37:12</publishTime>
    </File>
    <File Include="bin/BouncyCastle.Crypto.dll">
      <publishTime>12/18/2020 05:32:28</publishTime>
    </File>
    <File Include="bin/DAL.dll">
      <publishTime>12/03/2025 22:10:50</publishTime>
      <publishTime>12/08/2025 11:36:48</publishTime>
    </File>
    <File Include="bin/DAL.pdb">
      <publishTime>12/03/2025 22:10:50</publishTime>
      <publishTime>12/08/2025 11:36:48</publishTime>
    </File>
    <File Include="bin/Dapper.dll">
      <publishTime>07/22/2016 22:52:40</publishTime>
@@ -285,19 +285,19 @@
      <publishTime>05/09/2023 10:43:40</publishTime>
    </File>
    <File Include="bin/TopSdk.dll">
      <publishTime>12/02/2025 09:07:14</publishTime>
      <publishTime>12/04/2025 15:04:18</publishTime>
    </File>
    <File Include="bin/TopSdk.pdb">
      <publishTime>12/02/2025 09:07:14</publishTime>
      <publishTime>12/04/2025 15:04:18</publishTime>
    </File>
    <File Include="bin/WebActivatorEx.dll">
      <publishTime>11/24/2014 19:18:48</publishTime>
    </File>
    <File Include="bin/WebAPI.dll">
      <publishTime>12/04/2025 09:53:50</publishTime>
      <publishTime>12/09/2025 12:04:18</publishTime>
    </File>
    <File Include="bin/WebAPI.pdb">
      <publishTime>12/04/2025 09:53:50</publishTime>
      <publishTime>12/09/2025 12:04:18</publishTime>
    </File>
    <File Include="bin/WebAPI.XmlSerializers.dll">
      <publishTime>02/12/2025 14:57:06</publishTime>
WebAPI/WebAPI.csproj.user
@@ -5,17 +5,12 @@
    <NameOfLastUsedPublishProfile>C:\Users\86130\Desktop\智云迈思\MES-WEB-API\WebAPI\Properties\PublishProfiles\FolderProfilewtt.pubxml</NameOfLastUsedPublishProfile>
    <LastActiveSolutionConfig>Debug|Any CPU</LastActiveSolutionConfig>
    <NameOfLastUsedPublishProfile>C:\Users\86130\Desktop\智云迈思\MES-WEB-API\WebAPI\Properties\PublishProfiles\FolderProfilewtt.pubxml</NameOfLastUsedPublishProfile>
    <LastActiveSolutionConfig>Debug|Any CPU</LastActiveSolutionConfig>
    <LastActiveSolutionConfig>Debug|x86</LastActiveSolutionConfig>
    <NameOfLastUsedPublishProfile>C:\Users\86130\Desktop\智云迈思\MES-WEB-API\WebAPI\Properties\PublishProfiles\FolderProfilewtt.pubxml</NameOfLastUsedPublishProfile>
    <NameOfLastUsedPublishProfile>C:\Users\19858\Desktop\智云迈思\MES-WEB-API\WebAPI\Properties\PublishProfiles\FolderProfilewtt.pubxml</NameOfLastUsedPublishProfile>
    <NameOfLastUsedPublishProfile>C:\Users\19858\Desktop\智云迈思\MES-WEB-API\WebAPI\Properties\PublishProfiles\FolderProfilewtt.pubxml</NameOfLastUsedPublishProfile>
    <NameOfLastUsedPublishProfile>C:\Users\19858\Desktop\智云迈思\MES-WEB-API\WebAPI\Properties\PublishProfiles\FolderProfilewtt.pubxml</NameOfLastUsedPublishProfile>
<<<<<<< HEAD
    <NameOfLastUsedPublishProfile>C:\Users\19858\Desktop\智云迈思\MES-WEB-API\WebAPI\Properties\PublishProfiles\FolderProfilewtt.pubxml</NameOfLastUsedPublishProfile>
    <NameOfLastUsedPublishProfile>C:\Users\19858\Desktop\智云迈思\MES-WEB-API\WebAPI\Properties\PublishProfiles\FolderProfilewtt.pubxml</NameOfLastUsedPublishProfile>
=======
    <NameOfLastUsedPublishProfile>D:\工作代码\智云迈思\MES\MES-WEB-API\WebAPI\Properties\PublishProfiles\FolderProfile8.pubxml</NameOfLastUsedPublishProfile>
>>>>>>> fccf02cb2cc7b88e649f8e66230e190dce41abc1
    <UseIISExpress>true</UseIISExpress>
    <Use64BitIISExpress />
    <IISExpressSSLPort />