From a7d17c8ecf0076d00e1199cfc5ea8e7d44749ac6 Mon Sep 17 00:00:00 2001 From: yangle <admin@YINMOU> Date: 星期六, 06 五月 2023 09:17:27 +0800 Subject: [PATCH] Merge branch 'master' of http://101.37.171.70:10101/r/MES-WEB-API --- WebAPI/Controllers/CJGL/Mes_OrderProcFlowAllReportController.cs | 196 ++++++++++++++++++++++++++++++++ Pub_Class/CustomerCls/ClsXt_SystemParameter.cs | 5 WebAPI/Controllers/BaseSet/Gy_MaterialController.cs | 48 ++++--- WebAPI/Controllers/LMESController.cs | 64 +++++++++- WebAPI/Controllers/基础资料/工资基础资料/Gy_ProcPriceController.cs | 2 5 files changed, 282 insertions(+), 33 deletions(-) diff --git a/Pub_Class/CustomerCls/ClsXt_SystemParameter.cs b/Pub_Class/CustomerCls/ClsXt_SystemParameter.cs index 1d02c35..6bbdc24 100644 --- a/Pub_Class/CustomerCls/ClsXt_SystemParameter.cs +++ b/Pub_Class/CustomerCls/ClsXt_SystemParameter.cs @@ -1648,6 +1648,11 @@ omodel.Sc_MESProceReportWorkBill_AutoCheck = ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HValue"]); } + //条码主档删除人必须是制单人('Y'为控制) + if (ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HKey"]) == "BarCode_DeleterAndMakerMustSame") + { + omodel.BarCode_DeleterAndMakerMustSame = ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HValue"]); + } ////=========工序进站单 ////自动匹配流水号 //if (ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HKey"]) == "MES_StationBill_ProcNo") diff --git a/WebAPI/Controllers/BaseSet/Gy_MaterialController.cs b/WebAPI/Controllers/BaseSet/Gy_MaterialController.cs index 485d949..ebac8df 100644 --- a/WebAPI/Controllers/BaseSet/Gy_MaterialController.cs +++ b/WebAPI/Controllers/BaseSet/Gy_MaterialController.cs @@ -608,17 +608,7 @@ string HInterID = HInter.Replace("\"", ""); string user = sArray[1].ToString(); string HBarCode = sArray[2].ToString().Replace("\"",""); - string HComputerName = SystemInformation.ComputerName; //璁惧鍚嶇О - - //缂栬緫鏉冮檺 - if (!DBUtility.ClsPub.Security_Log("Gy_BarCodeBillList_Edit", 1, false, user)) - { - objJsonResult.code = "0"; - objJsonResult.count = 0; - objJsonResult.Message = "鏃犲垹闄ゆ潈闄愶紒"; - objJsonResult.data = null; - return objJsonResult; - } + string HComputerName = SystemInformation.ComputerName; //璁惧鍚嶇О try { @@ -626,6 +616,16 @@ string[] NewBarCode; NewBarCode = HBarCode.Split(Convert.ToChar(",")); + + //缂栬緫鏉冮檺 + if (!DBUtility.ClsPub.Security_Log("Gy_BarCodeBill_Del", 1, false, user)) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鏃犲垹闄ゆ潈闄愶紒"; + objJsonResult.data = null; + return objJsonResult; + } //鍒犻櫎鏉$爜鍓嶈繘琛屽垽鏂� Ds = oCN.RunProcReturn("exec h_p_Gy_BarCodeBill_MulDelete_Before '" + HInterID + "','" + HBarCode + "'", "h_p_Gy_BarCodeBill_MulDelete_Before", ref DBUtility.ClsPub.sExeReturnInfo); @@ -664,18 +664,20 @@ { oCN.BeginTran(); - ////鑾峰彇绯荤粺鍙傛暟 - //string Ret = ""; - //if (oSystemParameter.ShowBill(ref Ret)) - //{ - // //鍒ゆ柇鏄惁鍙兘鍒犻櫎鑷繁鐢熸垚鐨勬潯鐮� - // if (oSystemParameter.omodel.BarCode_DeleterAndMakerllustSame != "榫欏北姹介厤") //绯荤粺鍙傛暟 - // { - - // } - //} - - oCN.RunProc("Delete from Gy_BarCodeBill Where HItemID in (" + HInterID + ")"); + //鑾峰彇绯荤粺鍙傛暟 + string Ret = ""; + if (oSystemParameter.ShowBill(ref Ret)) + { + //鍒ゆ柇鏄惁鍙兘鍒犻櫎鑷繁鐢熸垚鐨勬潯鐮� + if (oSystemParameter.omodel.BarCode_DeleterAndMakerMustSame == "Y") //绯荤粺鍙傛暟 + { + oCN.RunProc("Delete from Gy_BarCodeBill Where HItemID in (" + HInterID + ")" + " and HMaker = '" + user + "'"); + } + else + { + oCN.RunProc("Delete from Gy_BarCodeBill Where HItemID in (" + HInterID + ")"); + } + } //鍐欏叆绯荤粺鏃ュ織 for (int i = 0; i <= NewBarCode.Length - 1; i++) diff --git a/WebAPI/Controllers/CJGL/Mes_OrderProcFlowAllReportController.cs b/WebAPI/Controllers/CJGL/Mes_OrderProcFlowAllReportController.cs index 00411ab..6d09fc3 100644 --- a/WebAPI/Controllers/CJGL/Mes_OrderProcFlowAllReportController.cs +++ b/WebAPI/Controllers/CJGL/Mes_OrderProcFlowAllReportController.cs @@ -130,7 +130,8 @@ } #endregion - #region 涓嶈壇鏄庣粏鑹巼鎶ヨ〃 鏌ヨ + + #region 杞﹂棿鐢熶骇姹囨姤缁熻琛� 鏌ヨ [Route("Mes_OrderProcFlowAllReport/StationOutSumReportList")] [HttpGet] public object StationOutSumReportList(string sWhere) @@ -166,5 +167,198 @@ } } #endregion + + + #region 璁′欢宸ヨ祫鎶ヨ〃 鏌ヨ + [Route("Mes_OrderProcFlowAllReport/EmployeePiecePayReport")] + [HttpGet] + public object EmployeePiecePayReport(string sWhere) + { + try + { + //鍙嶅簭鍒楀寲浼犻�掔殑鍊� + + ds = oCN.RunProcReturn("exec h_p_Sc_EmployeePiecePayReport " + sWhere + "", "h_p_Sc_EmployeePiecePayReport"); + + List<object> listCol = new List<object>(); + foreach (DataColumn col in ds.Tables[0].Columns) + { + Type dataType = col.DataType; + string str = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}"; + listCol.Add(JsonConvert.DeserializeObject(str)); + } + + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "Sucess锛�"; + objJsonResult.data = ds.Tables[0]; + objJsonResult.list = listCol; + return objJsonResult; + } + catch (Exception e) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "Exception锛�" + e.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + #endregion + + + #region 璁′欢宸ヨ祫姹囨�绘姤琛� 鏌ヨ + [Route("Mes_OrderProcFlowAllReport/EmployeePiecePaySumReport")] + [HttpGet] + public object EmployeePiecePaySumReport(string sWhere) + { + try + { + //鍙嶅簭鍒楀寲浼犻�掔殑鍊� + + ds = oCN.RunProcReturn("exec h_p_Sc_EmployeePiecePaySumReport " + sWhere + "", "h_p_Sc_EmployeePiecePaySumReport"); + + List<object> listCol = new List<object>(); + foreach (DataColumn col in ds.Tables[0].Columns) + { + Type dataType = col.DataType; + string str = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}"; + listCol.Add(JsonConvert.DeserializeObject(str)); + } + + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "Sucess锛�"; + objJsonResult.data = ds.Tables[0]; + objJsonResult.list = listCol; + return objJsonResult; + } + catch (Exception e) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "Exception锛�" + e.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + #endregion + + + #region 宸ヨ祫姹囨姤鏃ユ姤琛� 鏌ヨ + [Route("Mes_OrderProcFlowAllReport/EmployeePieceWorkReport")] + [HttpGet] + public object EmployeePieceWorkReport(string sWhere) + { + try + { + //鍙嶅簭鍒楀寲浼犻�掔殑鍊� + + ds = oCN.RunProcReturn("exec h_p_Sc_EmployeePieceWorkReport " + sWhere + "", "h_p_Sc_EmployeePieceWorkReport"); + + List<object> listCol = new List<object>(); + foreach (DataColumn col in ds.Tables[0].Columns) + { + Type dataType = col.DataType; + string str = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}"; + listCol.Add(JsonConvert.DeserializeObject(str)); + } + + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "Sucess锛�"; + objJsonResult.data = ds.Tables[0]; + objJsonResult.list = listCol; + return objJsonResult; + } + catch (Exception e) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "Exception锛�" + e.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + #endregion + + + #region 鐢熶骇杞﹂棿宸ュ簭鎶ヨ〃 鏌ヨ + [Route("Mes_OrderProcFlowAllReport/WorkShopProcessWIPReport")] + [HttpGet] + public object WorkShopProcessWIPReport(string sWhere) + { + try + { + //鍙嶅簭鍒楀寲浼犻�掔殑鍊� + + ds = oCN.RunProcReturn("exec h_p_Sc_WorkShopProcessWIPReport " + sWhere + "", "h_p_Sc_WorkShopProcessWIPReport"); + + List<object> listCol = new List<object>(); + foreach (DataColumn col in ds.Tables[0].Columns) + { + Type dataType = col.DataType; + string str = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}"; + listCol.Add(JsonConvert.DeserializeObject(str)); + } + + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "Sucess锛�"; + objJsonResult.data = ds.Tables[0]; + objJsonResult.list = listCol; + return objJsonResult; + } + catch (Exception e) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "Exception锛�" + e.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + #endregion + + + #region 宸ュ簭鍦ㄥ埗鍝佹姤琛� 鏌ヨ + [Route("Mes_OrderProcFlowAllReport/WorkShopProcessWIPSumReport")] + [HttpGet] + public object WorkShopProcessWIPSumReport(string sWhere) + { + try + { + //鍙嶅簭鍒楀寲浼犻�掔殑鍊� + + ds = oCN.RunProcReturn("exec h_p_Sc_WorkShopProcessWIPSumReport " + sWhere + "", "h_p_Sc_WorkShopProcessWIPSumReport"); + + List<object> listCol = new List<object>(); + foreach (DataColumn col in ds.Tables[0].Columns) + { + Type dataType = col.DataType; + string str = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}"; + listCol.Add(JsonConvert.DeserializeObject(str)); + } + + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "Sucess锛�"; + objJsonResult.data = ds.Tables[0]; + objJsonResult.list = listCol; + 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 diff --git a/WebAPI/Controllers/LMESController.cs b/WebAPI/Controllers/LMESController.cs index 470d0fc..db1c9f7 100644 --- a/WebAPI/Controllers/LMESController.cs +++ b/WebAPI/Controllers/LMESController.cs @@ -363,14 +363,14 @@ try { //鍒ゆ柇鏄惁鏈夋煡璇㈡潈闄� - //if (!DBUtility.ClsPub.Security_Log("Gy_RoutingBill_Query", 1, false, user)) - //{ - // objJsonResult.code = "0"; - // objJsonResult.count = 0; - // objJsonResult.Message = "鏃犳潈闄愭煡璇�!"; - // objJsonResult.data = null; - // return objJsonResult; - //} + if (!DBUtility.ClsPub.Security_Log("Gy_RoutingBill_Query", 1, false, user)) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鏃犳潈闄愭煡璇�!"; + objJsonResult.data = null; + return objJsonResult; + } SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); if (sWhere == null || sWhere.Equals("")) @@ -521,6 +521,54 @@ #endregion + #region 宸ヨ壓璺嚎(缁存姢宸ヤ环) + /// <summary> + /// 杩斿洖宸ヨ壓璺嚎鍒楄〃 + ///鍙傛暟锛歴tring sql銆� + ///杩斿洖鍊硷細object銆� + /// </summary> + [Route("LEMS/MES_Gy_RoutingBillMainRates_Json")] + [HttpGet] + public object MES_Gy_RoutingBillMainRates_Json(string sWhere, string user) + { + DataSet ds; + try + { + //鍒ゆ柇鏄惁鏈夋煡璇㈡潈闄� + if (!DBUtility.ClsPub.Security_Log("Gy_RoutingBill_Query", 1, false, user)) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鏃犳潈闄愭煡璇�!"; + objJsonResult.data = null; + return objJsonResult; + } + + SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); + if (sWhere == null || sWhere.Equals("")) + { + ds = oCN.RunProcReturn("select * from h_v_Gy_RoutingBillList_MainRate order by hmainid desc", "h_v_Gy_RoutingBillList_MainRate"); + } + else + { + string sql1 = "select * from h_v_Gy_RoutingBillList_MainRate where 1 = 1 "; + string sql = sql1 + sWhere + " order by hmainid desc,cast(宸ュ簭鍙� as int)"; + ds = oCN.RunProcReturn(sql, "h_v_Gy_RoutingBillList_MainRate"); + } + } + catch (Exception e) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "娌℃湁杩斿洖浠讳綍璁板綍锛�" + e.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + return GetObjectJson(ds); + } + + #endregion + #endregion /// <summary> diff --git "a/WebAPI/Controllers/\345\237\272\347\241\200\350\265\204\346\226\231/\345\267\245\350\265\204\345\237\272\347\241\200\350\265\204\346\226\231/Gy_ProcPriceController.cs" "b/WebAPI/Controllers/\345\237\272\347\241\200\350\265\204\346\226\231/\345\267\245\350\265\204\345\237\272\347\241\200\350\265\204\346\226\231/Gy_ProcPriceController.cs" index 70d50bf..f829083 100644 --- "a/WebAPI/Controllers/\345\237\272\347\241\200\350\265\204\346\226\231/\345\267\245\350\265\204\345\237\272\347\241\200\350\265\204\346\226\231/Gy_ProcPriceController.cs" +++ "b/WebAPI/Controllers/\345\237\272\347\241\200\350\265\204\346\226\231/\345\267\245\350\265\204\345\237\272\347\241\200\350\265\204\346\226\231/Gy_ProcPriceController.cs" @@ -120,7 +120,7 @@ oSub.HMaterID = DBUtility.ClsPub.isLong(subList[i].HMaterIDCol); oSub.HProcID = DBUtility.ClsPub.isLong(subList[i].HProcIDCol); oSub.HSourceID = DBUtility.ClsPub.isLong(subList[i].HSourceIDCol); - oSub.HPrice = DBUtility.ClsPub.isLong(subList[i].HPriceCol); + oSub.HPrice = DBUtility.ClsPub.isDoule(subList[i].HPriceCol); oSub.HBeginDate = DBUtility.ClsPub.isDate(subList[i].HBeginDateCol); oSub.HEndDate = DBUtility.ClsPub.isDate(subList[i].HEndDateCol); oSub.HCostFlag = DBUtility.ClsPub.GridToBool(subList[i].HCostFlagCol); -- Gitblit v1.9.1