From 3eb99e4cb8be5175840c2e28f5f9d8ffd96e1ea4 Mon Sep 17 00:00:00 2001 From: duhe <226547893@qq.com> Date: 星期六, 28 十二月 2024 15:34:21 +0800 Subject: [PATCH] 系统配置:保存功能 --- WebAPI/Controllers/CJGL/Cj_StationOutBillController.cs | 110 ++++++++++++++++++++++++++++++++++++++++++++++++++----- 1 files changed, 100 insertions(+), 10 deletions(-) diff --git a/WebAPI/Controllers/CJGL/Cj_StationOutBillController.cs b/WebAPI/Controllers/CJGL/Cj_StationOutBillController.cs index 2580f9c..25f15f5 100644 --- a/WebAPI/Controllers/CJGL/Cj_StationOutBillController.cs +++ b/WebAPI/Controllers/CJGL/Cj_StationOutBillController.cs @@ -451,6 +451,7 @@ ",HSourceID5=" + HSourceID5 + ",HPayProcID=" + HPayProcID + ",HGroupID=" + HGroupID + + ",HShiftsID=" + HShiftsID + ",HWorkTimes=" + HWorkTimes + ",HSaveBillFlag=0 " + ",HBadCount=" + HBadCount + @@ -468,10 +469,9 @@ ",HWasterQty_Work=" + HWasterQty_Work + ",HWasterQty_Mater=" + HWasterQty_Mater + ",HBackWorkQty=" + HBackWorkQty + - ",HShiftsID=" + HShiftsID + ",HBackWorkByMaterQty=" + HBackWorkByMaterQty + ",HMouldID=" + HMouldID + - ",HMachineWorkTimes=" + HMachineWorkTimes + + ",HMachineWorkTimes=" + HMachineWorkTimes + " where HInterID=" + HInterID); LogService.Write("鐢ㄦ埛:" + user + ",鏃ユ湡:" + DateTime.Now + ",淇敼宸ュ簭鍑虹珯鍗曟嵁:" + HBillNo); @@ -1950,7 +1950,7 @@ 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/" + HBillNo); + string path = HttpContext.Current.Server.MapPath("~/../Files/Cj_StationOutBill/" + HBillNo); //string path = @"D:\\Files\\"+ HBillNo; dynamic dyResult = UpLoadFile(files, path, HBillNo, HRemark, HUserName); if (dyResult != null && dyResult.result == 1) @@ -2006,7 +2006,7 @@ { File.Delete(fileurl); //鍒犻櫎鎸囧畾鏂囦欢 files.SaveAs(fileurl); - string StrPath = "/files/"+ HBillNo+"/"+ filename; + string StrPath = "/files/Cj_StationOutBill/" + HBillNo+"/"+ filename; if (File.Exists(fileurl)) { //杩欓噷鍙互鎵ц涓�浜涘叾瀹冪殑鎿嶄綔锛屾瘮濡傛洿鏂版暟鎹簱 @@ -2029,7 +2029,7 @@ { Directory.CreateDirectory(fileSavePath); //娣诲姞鏂囦欢澶� files.SaveAs(fileurl); - string StrPath = "/files/" + HBillNo + "/" + filename; + string StrPath = "/files/Cj_StationOutBill/" + HBillNo + "/" + filename; if (File.Exists(fileurl)) { //杩欓噷鍙互鎵ц涓�浜涘叾瀹冪殑鎿嶄綔锛屾瘮濡傛洿鏂版暟鎹簱 @@ -2070,7 +2070,7 @@ 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/" + HBillNo); + string path = HttpContext.Current.Server.MapPath("~/../Files/Cj_StationOutBill/" + HBillNo); //string path = @"D:\\Files\\"+ HBillNo; dynamic dyResult = UpLoadFile1(files, path, HBillNo, HRemark, HUserName); if (dyResult != null && dyResult.result == 1) @@ -2126,7 +2126,7 @@ { File.Delete(fileurl); //鍒犻櫎鎸囧畾鏂囦欢 files.SaveAs(fileurl); - string StrPath = "/files/" + HBillNo + "/" + filename; + string StrPath = "/files/Cj_StationOutBill/" + HBillNo + "/" + filename; if (File.Exists(fileurl)) { //杩欓噷鍙互鎵ц涓�浜涘叾瀹冪殑鎿嶄綔锛屾瘮濡傛洿鏂版暟鎹簱 @@ -2149,7 +2149,7 @@ { Directory.CreateDirectory(fileSavePath); //娣诲姞鏂囦欢澶� files.SaveAs(fileurl); - string StrPath = "/files/" + HBillNo + "/" + filename; + string StrPath = "/files/Cj_StationOutBill/" + HBillNo + "/" + filename; if (File.Exists(fileurl)) { //杩欓噷鍙互鎵ц涓�浜涘叾瀹冪殑鎿嶄綔锛屾瘮濡傛洿鏂版暟鎹簱 @@ -2199,7 +2199,7 @@ [HttpGet] public object Filelist(string HBillNo) { - var url = fileip + "/files/" + HBillNo+"/"; + var url = fileip + "/files/Cj_StationOutBill/" + HBillNo+"/"; //@"C:\\files\\" try { @@ -2234,7 +2234,7 @@ { oCN.RunProc("delete from MES_AccessoriesList where HItemID =" + HItemID); - string fileurl = Path.Combine(HttpContext.Current.Server.MapPath("~/../Files/" + HSourceBillNo), HFileName); + string fileurl = Path.Combine(HttpContext.Current.Server.MapPath("~/../Files/Cj_StationOutBill/" + HSourceBillNo), HFileName); File.Delete(fileurl); //鍒犻櫎鎸囧畾鏂囦欢 objJsonResult.code = "1"; objJsonResult.count = 1; @@ -3976,5 +3976,95 @@ } } #endregion + + #region 缂栬緫椤甸潰鏍规嵁id鑾峰彇宸ュ簭鍑虹珯姹囨姤鍗曚俊鎭� + [Route("Cj_StationOutBill/SetBillTime")] + [HttpGet] + public object SetBillTime(int HInterID,DateTime dateTime,string user) + { + try + { + //鍒ゆ柇鏄惁鏈夌紪杈戞潈闄� + if (!DBUtility.ClsPub.Security_Log("Cj_StationOutBill_Edit", 1, false, user)) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鍑虹珯鍗曟棤缂栬緫鏉冮檺!"; + objJsonResult.data = null; + return objJsonResult; + } + string sql = "select * from Sc_StationOutBillMain with(nolock) where HInterID=" + HInterID; + ds = oCN.RunProcReturn(sql, "Sc_StationOutBillMain"); + if (ds == null || ds.Tables[0].Rows.Count == 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "淇敼澶辫触娌℃壘鍒扮浉鍏冲嚭绔欐眹鎶ュ崟"; + objJsonResult.data = null; + return objJsonResult; + } + //淇敼鍓嶆椂闂翠慨鏀瑰悗鏃堕棿鍒ゆ柇鏈夋棤宸ヨ祫璁$畻 + string HGroupID = ds.Tables[0].Rows[0]["HGroupID"].ToString(); + string HOldDate = ds.Tables[0].Rows[0]["HDate"].ToString(); + string sql1 = "select * from Pay_SingleBalBillMain where HGroupID =" +HGroupID + " and HDate ='" + HOldDate + "'"; + string sql2 = "select * from Pay_GroupBalBillMain where HGroupID =" + HGroupID + " and HDate ='" + HOldDate + "'"; + string sql3 = "select * from Pay_SingleBalBillMain where HGroupID =" + HGroupID + " and HDate ='" + dateTime + "'"; + string sql4 = "select * from Pay_GroupBalBillMain where HGroupID =" + HGroupID + " and HDate ='" + dateTime + "'"; + ds = oCN.RunProcReturn(sql1, "Sc_StationOutBillMain"); + if (ds.Tables[0].Rows.Count > 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "淇敼澶辫触璇ユ椂闂寸彮缁勫凡璁$畻宸ヨ祫:" + HOldDate; + objJsonResult.data = null; + return objJsonResult; + } + ds = oCN.RunProcReturn(sql2, "Sc_StationOutBillMain"); + if (ds.Tables[0].Rows.Count > 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "淇敼澶辫触璇ユ椂闂寸彮缁勫凡璁$畻宸ヨ祫:" + HOldDate; + objJsonResult.data = null; + return objJsonResult; + } + ds = oCN.RunProcReturn(sql3, "Sc_StationOutBillMain"); + if (ds.Tables[0].Rows.Count > 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "淇敼澶辫触璇ユ椂闂寸彮缁勫凡璁$畻宸ヨ祫:" + dateTime; + objJsonResult.data = null; + return objJsonResult; + } + ds = oCN.RunProcReturn(sql4, "Sc_StationOutBillMain"); + if (ds.Tables[0].Rows.Count > 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "淇敼澶辫触璇ユ椂闂寸彮缁勫凡璁$畻宸ヨ祫:" + dateTime; + objJsonResult.data = null; + return objJsonResult; + } + //淇敼鏃堕棿 + sql = "update Sc_StationOutBillMain set HDate = '" + dateTime + "' where HInterID = " + HInterID; + oCN.RunProcReturn(sql, "Sc_StationOutBillMain"); + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "Sucess锛�"; + 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 } } \ No newline at end of file -- Gitblit v1.9.1