From 81c2a1c9635bdfb714d9a04b4bb08be6e060e99c Mon Sep 17 00:00:00 2001 From: yusijie <ysj@hz-kingdee.com> Date: 星期一, 16 十二月 2024 09:49:06 +0800 Subject: [PATCH] Merge branch 'master' of http://101.37.171.70:10101/r/MES-WEB-API --- WebAPI/Controllers/Sc_MouldRepairInBillListController.cs | 480 ++++++++++++++++++++++++++++++++++++++++++++++------------- 1 files changed, 374 insertions(+), 106 deletions(-) diff --git a/WebAPI/Controllers/Sc_MouldRepairInBillListController.cs b/WebAPI/Controllers/Sc_MouldRepairInBillListController.cs index 081f353..fa524c1 100644 --- a/WebAPI/Controllers/Sc_MouldRepairInBillListController.cs +++ b/WebAPI/Controllers/Sc_MouldRepairInBillListController.cs @@ -9,6 +9,7 @@ using System.Web.Http; using ViewAPI; using WebAPI.Models; +using SyntacticSugar.constant; namespace WebAPI.Controllers { /** @@ -767,81 +768,7 @@ //} #endregion - /// <summary> - /// 妯″叿缁翠慨宸ュ崟琛ㄥ垪琛� - /// </summary> - /// <returns></returns> - [Route("Sb_MouldRepairWorkBill/GetMouldRepairWorkBillList")] - [HttpGet] - public object GetMouldRepairWorkBillList(string sWhere,string user) - { - try - { - List<object> columnNameList = new List<object>(); - if (!DBUtility.ClsPub.Security_Log("Sb_MouldRepairWorkBillList", 1, false, user)) - { - objJsonResult.code = "0"; - objJsonResult.count = 0; - objJsonResult.Message = "鏃犳煡鐪嬫潈闄愶紒"; - objJsonResult.data = null; - return objJsonResult; - } - - ds = Sc_MouldRepairWorkBillList_s(sWhere); - - //娣诲姞鍒楀悕 - 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));//鑾峰彇鍒癉ataColumn鍒楀璞$殑鍒楀悕 - } - - //if (ds.Tables[0].Rows.Count != 0 || ds != null) - //{ - objJsonResult.code = "1"; - objJsonResult.count = 1; - objJsonResult.Message = "Sucess锛�"; - objJsonResult.data = ds.Tables[0]; - objJsonResult.list = columnNameList; - return objJsonResult; - //} - //else - //{ - //objJsonResult.code = "0"; - //objJsonResult.count = 0; - //objJsonResult.Message = "鏃犳暟鎹�"; - //objJsonResult.data = null; - //return objJsonResult; - //} - } - catch (Exception ex) - { - objJsonResult.code = "0"; - objJsonResult.count = 0; - objJsonResult.Message = "娌℃湁杩斿洖浠讳綍璁板綍锛�" + ex.ToString(); - objJsonResult.data = null; - return objJsonResult; - } - } - - #region sql璇彞 - - - public static DataSet Sc_MouldRepairWorkBillList_s(string sWhere) - { - if (sWhere == null || sWhere.Equals("")) - { - return new SQLHelper.ClsCN().RunProcReturn("select * from h_v_Sc_MouldRepairWorkBillList where 1=1 " + sWhere+ " order by hmainid desc", "h_v_Sc_MouldRepairWorkBillList"); - } - else - { - string sql1 = "select * from h_v_Sc_MouldRepairWorkBillList where 1 = 1 "; - string sql = sql1 + sWhere + "order by hmainid desc"; - return new SQLHelper.ClsCN().RunProcReturn(sql, "h_v_Sc_MouldRepairWorkBillList"); - } - } - #endregion + /// <summary> @@ -4052,6 +3979,7 @@ #endregion + #region 妯″叿缁翠慨璁板綍鍗� #region 妯″叿缁翠慨璁板綍鍗曚繚瀛�/缂栬緫 /// <summary> @@ -4511,6 +4439,253 @@ } #endregion + #region 妯″叿缁翠慨璁板綍鍗曚繚瀛�/缂栬緫 + /// <summary> + /// 淇濆瓨妯″叿缁翠慨鍗� + /// </summary> + /// <param name="msg"></param> + /// <returns></returns> + [Route("Sb_MouldRepairWorkBill/SaveGetMouldRepairWorkBill_PDA")] + [HttpPost] + public object SaveGetMouldRepairWorkBill_PDA([FromBody] JObject msg) + { + var _value = msg["msg"].ToString(); + string msg1 = _value.ToString(); + string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries); + string msg2 = sArray[0].ToString(); + string msg3 = sArray[1].ToString(); + string msg4 = sArray[2].ToString(); + + + string UserName = ""; + ListModels oListModels = new ListModels(); + try + { + if (!DBUtility.ClsPub.Security_Log("Sb_MouldRepairWorkBill_Edit", 1, false, msg4)) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鏃犱繚瀛樻潈闄愶紒"; + objJsonResult.data = null; + return objJsonResult; + } + + DAL.ClsSb_MouldRepairWorkBill oBill = new DAL.ClsSb_MouldRepairWorkBill(); + List<Model.ClsSb_MouldRepairWorkBillMain> lsmain = new List<Model.ClsSb_MouldRepairWorkBillMain>(); + msg2 = msg2.Replace("\\", ""); + msg2 = msg2.Replace("\n", ""); //\n + lsmain = oListModels.getObjectByJson_Gy_MouldRepairWorkBillMain(msg2); + foreach (Model.ClsSb_MouldRepairWorkBillMain oItem in lsmain) + { + oItem.HMaker = msg4; + UserName = msg4; //鍒跺崟浜� + oItem.HBillType = "3807"; + oItem.HBillSubType = "3807"; + oItem.HYear = DBUtility.ClsPub.isLong(DateTime.Now.Year); + oItem.HMakeDate = DBUtility.ClsPub.isStrNull(DateTime.Now.ToString("yyyy-MM-dd")); + if (DBUtility.ClsPub.isStrNull(oItem.HDate) == "") + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "淇濆瓨澶辫触锛佹病鏈夊崟鎹棩鏈燂紝鏃犳硶淇濆瓨锛�"; + objJsonResult.data = 1; + return objJsonResult; + } + oBill.omodel = oItem; + } + //琛ㄤ綋鏁版嵁 + //鎸� },{鏉ユ媶鍒嗘暟缁� //鍘绘帀銆愬拰銆� + msg3 = msg3.Substring(1, msg3.Length - 2); + msg3 = msg3.Replace("\\", ""); + msg3 = msg3.Replace("\n", ""); //\n + //msg2 = msg2.Replace("'", "鈥�"); + List<Model.ClsSb_MouldRepairWorkBillSub> ls = new List<Model.ClsSb_MouldRepairWorkBillSub>(); + ls = oListModels.getObjectByJson_Gy_MouldRepairWorkBillSub(msg3); + int i = 0; + foreach (Model.ClsSb_MouldRepairWorkBillSub oItem in ls) + { + + i++; + oItem.HEntryID = i; + oItem.HEntryCloseDate = DBUtility.ClsPub.isDate(DateTime.Now); + oItem.HCloseType = false; //鍏抽棴绫诲瀷 + oItem.HRelationQty = 0; //鍏宠仈鏁伴噺 + oBill.DetailColl.Add(oItem); + + } + + + //淇濆瓨 + //淇濆瓨瀹屾瘯鍚庡鐞� + bool bResult; + if (oBill.omodel.HInterID == 0) + { + bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo); + } + else + { + bResult = oBill.ModifyBill(oBill.omodel.HInterID, ref DBUtility.ClsPub.sExeReturnInfo); + } + if (bResult) + { + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "淇濆瓨鎴愬姛锛�"; + objJsonResult.data = 1; + return objJsonResult; + } + else + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "淇濆瓨澶辫触锛�" + DBUtility.ClsPub.sExeReturnInfo; + objJsonResult.data = 1; + return objJsonResult; + } + } + catch (Exception e) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "淇濆瓨澶辫触锛�" + e.ToString(); + objJsonResult.data = 1; + return objJsonResult; + } + } + #endregion + + #region 妯″叿缁翠慨璁板綍琛ㄥ垪琛� + [Route("Sb_MouldRepairWorkBill/GetMouldRepairWorkBillList")] + [HttpGet] + public object GetMouldRepairWorkBillList(string sWhere, string user) + { + try + { + List<object> columnNameList = new List<object>(); + if (!DBUtility.ClsPub.Security_Log("Sb_MouldRepairWorkBillList", 1, false, user)) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鏃犳煡鐪嬫潈闄愶紒"; + objJsonResult.data = null; + return objJsonResult; + } + + ds = Sc_MouldRepairWorkBillList_s(sWhere); + + //娣诲姞鍒楀悕 + 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));//鑾峰彇鍒癉ataColumn鍒楀璞$殑鍒楀悕 + } + + //if (ds.Tables[0].Rows.Count != 0 || ds != null) + //{ + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "Sucess锛�"; + objJsonResult.data = ds.Tables[0]; + objJsonResult.list = columnNameList; + return objJsonResult; + //} + //else + //{ + //objJsonResult.code = "0"; + //objJsonResult.count = 0; + //objJsonResult.Message = "鏃犳暟鎹�"; + //objJsonResult.data = null; + //return objJsonResult; + //} + } + catch (Exception ex) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "娌℃湁杩斿洖浠讳綍璁板綍锛�" + ex.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + + public static DataSet Sc_MouldRepairWorkBillList_s(string sWhere) + { + if (sWhere == null || sWhere.Equals("")) + { + return new SQLHelper.ClsCN().RunProcReturn("select * from h_v_Sc_MouldRepairWorkBillList where 1=1 " + sWhere + " order by hmainid desc", "h_v_Sc_MouldRepairWorkBillList"); + } + else + { + string sql1 = "select * from h_v_Sc_MouldRepairWorkBillList where 1 = 1 "; + string sql = sql1 + sWhere + "order by hmainid desc"; + return new SQLHelper.ClsCN().RunProcReturn(sql, "h_v_Sc_MouldRepairWorkBillList"); + } + } + #endregion + + #region 妯″叿缁翠慨璁板綍琛ㄥ垪琛� + [Route("Sb_MouldRepairWorkBill/GetMouldRepairWorkBill_PDA")] + [HttpGet] + public object GetMouldRepairWorkBill_PDA(string sWhere, string user) + { + try + { + List<object> columnNameList = new List<object>(); + if (!DBUtility.ClsPub.Security_Log("Sb_MouldRepairWorkBillList", 1, false, user)) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鏃犳煡鐪嬫潈闄愶紒"; + objJsonResult.data = null; + return objJsonResult; + } + + ds = Sc_MouldRepairWorkBillList_PDA(sWhere); + + //娣诲姞鍒楀悕 + 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));//鑾峰彇鍒癉ataColumn鍒楀璞$殑鍒楀悕 + } + + 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; + } + } + + public static DataSet Sc_MouldRepairWorkBillList_PDA(string sWhere) + { + if (sWhere == null || sWhere.Equals("")) + { + return new SQLHelper.ClsCN().RunProcReturn("select * from h_v_Sc_MouldRepairWorkBillList_PDA where 1=1 " + sWhere + " order by hmainid desc", "h_v_Sc_MouldRepairWorkBillList_PDA"); + } + else + { + string sql1 = "select * from h_v_Sc_MouldRepairWorkBillList_PDA where 1 = 1 "; + string sql = sql1 + sWhere + "order by hmainid desc"; + return new SQLHelper.ClsCN().RunProcReturn(sql, "h_v_Sc_MouldRepairWorkBillList_PDA"); + } + } + #endregion + + #endregion + #region 鍣ㄥ叿缁翠慨璁板綍缁熻鍒嗘瀽 /// <summary> /// 鍣ㄥ叿缁翠慨璁板綍缁熻鍒嗘瀽 鍒楄〃 @@ -4563,7 +4738,7 @@ } #endregion - + #region 妯″叿楠屾敹鍗� #region 妯″叿缁翠慨楠屾敹鍗曚繚瀛�/缂栬緫 /// <summary> @@ -4852,6 +5027,7 @@ } #endregion + #endregion #region 妯″叿鏁呴殰鐧昏琛� @@ -4901,19 +5077,6 @@ //oItem.HInnerBillNo = ""; // --鍐呴儴鍗曟嵁鍙� oItem.HYear = DBUtility.ClsPub.isLong(DateTime.Now.Year); oItem.HMakeDate = DBUtility.ClsPub.isStrNull(DateTime.Now.ToString("yyyy-MM-dd")); - //oItem.HEquipID = 0; //璁惧ID(Gy_EquipMent) - //oItem.HPeriod = 0; - //oItem.HCheckBeginDate = DBUtility.ClsPub.isDate(DateTime.Now.ToString("yyyy-MM-dd")); // --缁翠慨鏃ユ湡 - //oItem.HCheckResult = ""; //楠屾敹缁撹--(姝e父锛屽紓甯�) - //oItem.HEmpID = 0; //楠屾敹浜�(Gy_Employee) - //oItem.HManagerID = 0; //璐熻矗浜�(Gy_Employee) - //oItem.HDeptID = 0; //楠屾敹閮ㄩ棬(Gy_Department) - //oItem.HExplanation = ""; //鎽樿(鏁呴殰鎻忚堪) - //oItem.HRemark = ""; //澶囨敞 - - //oItem.HMainSourceInterID = oItem.HInterID; - - //oItem.HInterID = DBUtility.ClsPub.CreateBillID_SRMProd("1103", ref DBUtility.ClsPub.sExeReturnInfo); if (DBUtility.ClsPub.isStrNull(oItem.HDate) == "") { objJsonResult.code = "0"; @@ -4939,22 +5102,11 @@ i++; oItemSub.HEntryID = i; - //oItemSub.HRepairCheckID = 0; //楠屾敹椤圭洰ID - //oItemSub.HRepairCheckContent = ""; //楠屾敹鍐呭 - //oItemSub.HManagerID = 0; //璐熻矗浜篒D - //oItemSub.HCloseMan = ""; //琛屽叧闂� + oItemSub.HCloseType = false; //鍏抽棴绫诲瀷 - //oItemSub.HRemark = ""; //澶囨敞 + oItemSub.HSourceInterID = 0; // 婧愬崟涓诲唴鐮� oItemSub.HSourceEntryID = 0; //婧愬崟瀛愬唴鐮� - //oItemSub.HSourceBillNo = ""; //婧愬崟鍗曞彿 - //oItemSub.HSourceBillType = ""; //婧愬崟绫诲瀷 - //oItemSub.HRelationQty = 0; //鍏宠仈鏁伴噺 - //oItemSub.HRelationMoney = 0; //鍏宠仈閲戦 - //oItemSub.HRepairID = 0; //缁翠慨椤圭洰 - //oItemSub.HRepairExplanation =""; //缁翠慨瑕佹眰 - - //oItemSub.HMoney = 0; //缁翠慨璐圭敤 oBill.DetailColl.Add(oItemSub); } @@ -4963,7 +5115,6 @@ bool bResult; if (oBill.omodel.HInterID == 0) { - // bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo); bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo); } else @@ -4975,7 +5126,6 @@ objJsonResult.code = "0"; objJsonResult.count = 1; objJsonResult.Message = "淇濆瓨鎴愬姛锛�"; - //WebAPIController.Add_Log("閫佽揣鍗曚笅鎺�", UserName, "鐢熸垚閫佽揣鍗�"); objJsonResult.data = 1; return objJsonResult; } @@ -5140,6 +5290,68 @@ } } #endregion + + #region 妯″叿鏁呴殰鐧昏鍗昣PDA + [Route("Sc_MouldConkBookBill/GetMouldConkBookBillList_PDA")] + [HttpGet] + public object GetMouldConkBookBillList_PDA(string sWhere, string user) + { + try + { + List<object> columnNameList = new List<object>(); + if (!DBUtility.ClsPub.Security_Log("Sc_MouldConkBookBillList", 1, false, user)) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鏃犱繚瀛樻潈闄愶紒"; + objJsonResult.data = null; + return objJsonResult; + } + + ds = Sc_MouldConkBookBillList_PDA(sWhere); + + //娣诲姞鍒楀悕 + 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));//鑾峰彇鍒癉ataColumn鍒楀璞$殑鍒楀悕 + } + + 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; + } + } + + public static DataSet Sc_MouldConkBookBillList_PDA(string sWhere) + { + DataSet ds; + if (sWhere == null || sWhere.Equals("")) + { + ds = new SQLHelper.ClsCN().RunProcReturn("select * from h_v_Sc_MouldConkBookBillList_PDA where 1=1 " + sWhere + " order by hmainid desc", "h_v_Sc_MouldConkBookBillList_PDA"); + } + else + { + string sql1 = "select * from h_v_Sc_MouldConkBookBillList_PDA where 1 = 1 "; + string sql = sql1 + sWhere + "order by 鏃ユ湡 desc"; + ds = new SQLHelper.ClsCN().RunProcReturn(sql, "h_v_Sc_MouldConkBookBillList_PDA"); + } + return ds; + } + #endregion + #endregion @@ -7654,6 +7866,62 @@ } #endregion + + #region 妯″叿澶勭悊鍑哄簱鍗曞垎椤靛垪琛� + [Route("Sc_MouldScrapOutHouseBill/page")] + [HttpGet] + public object Sc_MouldScrapOutHouseBillPage(string sWhere, string user, int page, int size) + { + DataSet ds; + try + { + List<object> columnNameList = new List<object>(); + //鏉冮檺 + if (!DBUtility.ClsPub.Security_Log("Sc_MouldScrapOutBillList", 1, false, user)) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鏃犳煡鐪嬫潈闄愶紒"; + objJsonResult.data = null; + return objJsonResult; + } + + sWhere = sWhere.Replace("'", "''"); + if (sWhere == null || sWhere.Equals("")) + { + ds = oCN.RunProcReturn("exec h_p_Sc_MouldScrapOutHouseBillList " + page + "," + size + ",''", "h_p_Sc_MouldScrapOutHouseBillList"); + } + else + { + ds = oCN.RunProcReturn("exec h_p_Sc_MouldScrapOutHouseBillList " + page + "," + size + ",'" + sWhere + "'", "h_p_Sc_MouldScrapOutHouseBillList"); + } + + //娣诲姞鍒楀悕 + 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));//鑾峰彇鍒癉ataColumn鍒楀璞$殑鍒楀悕 + } + + objJsonResult.code = CodeConstant.SUCCEED; + objJsonResult.count = int.Parse(ds.Tables[1].Rows[0]["count"].ToString()); + objJsonResult.Message = "Sucess锛�"; + objJsonResult.list = columnNameList; + objJsonResult.data = ds.Tables[0]; + return objJsonResult; + } + catch (Exception e) + { + objJsonResult.code = CodeConstant.FAIL; + objJsonResult.count = CountConstant.FAIL; + objJsonResult.Message = "Exception锛�" + e.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + #endregion + #region[妯″叿澶勭悊鍑哄簱鍗曠紪杈戞椂鑾峰彇琛ㄥご鏁版嵁] [Route("Sc_MouldScrapOutHouseBill/Sc_MouldScrapOutHouseBillListCheckDetai")] @@ -10671,7 +10939,7 @@ return objJsonResult; } } - #endregion - + #endregion + } } \ No newline at end of file -- Gitblit v1.9.1