using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Data; using System.Collections; using CoreFS.CA06; using Core.Mes.Client.Comm.Server; namespace Core.StlMes.Client.PlnSaleOrd { class FrmDefGroup { /// /// 计算热处理默认分组 /// /// 外径 /// 壁厚 /// 长度上限 /// 热处理二级工序 /// 扣型 /// 平台ob /// public static string defgourpRcl(double outdiameter, double wallthick, double lengthmax, string processC, string modelCode, OpeBase opeBase) { string processStyle = ""; string modelStyle = ""; string groupRcl = ""; //二级工序分类 DataTable dt1 = ServerHelper.GetData("com.steering.pss.plnsaleord.order.baseMethod.CoreDefGourp.queryProcessStyle", new object[] { processC }, opeBase); if (dt1 != null && dt1.Rows.Count > 0) { processStyle = dt1.Rows[0]["PROCESS_STYLE"].ToString(); } //扣型分类 DataTable dt2 = ServerHelper.GetData("com.steering.pss.plnsaleord.order.baseMethod.CoreDefGourp.queryModelStyle", new object[] { modelCode }, opeBase); if (dt2 != null && dt2.Rows.Count > 0) { modelStyle = dt2.Rows[0]["MODEL_STYLE"].ToString(); } if (lengthmax < 12) { //非调质或仅探伤 if (processStyle.Equals("407202") || processStyle.Equals("407203")) { if (modelStyle.Equals("405106")) //热轧 { if (outdiameter < 275 && wallthick < 30) { //轧管二部 groupRcl = "200502"; } } if (modelStyle.Equals("405101")) //不车丝、倒棱 { if (outdiameter < 144) { //轧管二部 groupRcl = "200502"; } } } } if (groupRcl.Equals("")) { //管加工部 groupRcl = "200501"; } return groupRcl; } /// /// 计算加工默认分组 /// /// 外径 /// 扣型 /// 平台ob /// public static string defgourpJgc(double outdiameter, string modelCode, OpeBase opeBase) { string modelStyle = ""; string groupJgx = ""; //扣型分类 DataTable dt = ServerHelper.GetData("com.steering.pss.plnsaleord.order.baseMethod.CoreDefGourp.queryModelStyle", new object[] { modelCode }, opeBase); if (dt != null && dt.Rows.Count > 0) { modelStyle = dt.Rows[0]["MODEL_STYLE"].ToString(); } if (outdiameter <= 114) { if (modelStyle.Equals("405101")) { //轧管二部 groupJgx = "200402"; } if (outdiameter >= 33 && outdiameter <= 114) { //热轧 if (modelStyle.Equals("405106")) { //轧管二部 groupJgx = "200402"; } } } else if (outdiameter >= 140 && outdiameter <= 273) { //热轧 if (modelStyle.Equals("405106")) { //轧管二部 groupJgx = "200402"; } } if (groupJgx.Equals("")) { //管加工部 groupJgx = "200401"; } return groupJgx; } /// /// 获取工序评审产线分组 /// /// 质量设计 /// 制程 /// /// public static string[] planGroups(string desginKey, string mscPline,string processCode, OpeBase _ob) { DataTable dt = ServerHelper.GetData("com.steering.pss.plnsaleord.order.baseMethod.CoreDefGourp.queryProcessPlineGroup", new object[] { desginKey, mscPline, processCode }, _ob); if (dt != null && dt.Rows.Count > 0) { string[] planGroups = new string[dt.Rows.Count]; for (int i = 0; i < dt.Rows.Count; i++) { planGroups[i] = dt.Rows[i]["GROUP_PLAN"].ToString(); } return planGroups; } return null; } /// /// 计算热处理默认分组 /// /// 计划分组 /// 外径 /// 壁厚 /// 长度上限 /// 热处理二级工序 /// 扣型 /// 平台ob /// public static string defgourpRcl(string[] planGroups, double outdiameter, double wallthick, double lengthmax, string processC, string modelCode, OpeBase opeBase) { string processStyle = ""; string modelStyle = ""; string groupRcl = ""; //二级工序分类 DataTable dt1 = ServerHelper.GetData("com.steering.pss.plnsaleord.order.baseMethod.CoreDefGourp.queryProcessStyle", new object[] { processC }, opeBase); if (dt1 != null && dt1.Rows.Count > 0) { processStyle = dt1.Rows[0]["PROCESS_STYLE"].ToString(); } //扣型分类 DataTable dt2 = ServerHelper.GetData("com.steering.pss.plnsaleord.order.baseMethod.CoreDefGourp.queryModelStyle", new object[] { modelCode }, opeBase); if (dt2 != null && dt2.Rows.Count > 0) { modelStyle = dt2.Rows[0]["MODEL_STYLE"].ToString(); } if (lengthmax < 12) { //非调质或仅探伤 if (processStyle.Equals("407202") || processStyle.Equals("407203")) { if (modelStyle.Equals("405106")) //热轧 { if (outdiameter < 275 && wallthick < 30) { //轧管二部 groupRcl = "200502"; } } if (modelStyle.Equals("405101")) //不车丝、倒棱 { if (outdiameter < 144) { //轧管二部 groupRcl = "200502"; } } } } if (groupRcl.Equals("")) { //管加工部 groupRcl = "200501"; } if (!planGroups.Contains(groupRcl) && planGroups.Count() > 0) { groupRcl = planGroups[0]; } return groupRcl; } /// /// 计算加工默认分组 /// /// 计划分组 /// 外径 /// 扣型 /// 平台ob /// public static string defgourpJgc(string[] planGroups, double outdiameter, string modelCode, OpeBase opeBase) { string modelStyle = ""; string groupJgx = ""; //扣型分类 DataTable dt = ServerHelper.GetData("com.steering.pss.plnsaleord.order.baseMethod.CoreDefGourp.queryModelStyle", new object[] { modelCode }, opeBase); if (dt != null && dt.Rows.Count > 0) { modelStyle = dt.Rows[0]["MODEL_STYLE"].ToString(); } if (outdiameter <= 114) { if (modelStyle.Equals("405101")) { //轧管二部 groupJgx = "200402"; } if (outdiameter >= 33 && outdiameter <= 114) { //热轧 if (modelStyle.Equals("405106")) { //轧管二部 groupJgx = "200402"; } } } else if (outdiameter >= 140 && outdiameter <= 273) { //热轧 if (modelStyle.Equals("405106")) { //轧管二部 groupJgx = "200402"; } } if (groupJgx.Equals("")) { //管加工部 groupJgx = "200401"; } if (!planGroups.Contains(groupJgx) && planGroups.Count() > 0) { groupJgx = planGroups[0]; } return groupJgx; } /// /// 获取加工优先分组 /// /// /// /// /// /// public static string DefJgxGourp(string desginKey, string mscPline, string bom, OpeBase opeBase) { string groupJgx = "200401";//管加工部 CoreClientParam ccp = new CoreClientParam(); ccp.ServerName = "com.steering.pss.plnsaleord.order.baseMethod.CoreDefGourp"; ccp.MethodName = "selectJgxDefGroup"; ccp.ServerParams = new object[] { desginKey, mscPline, bom }; ccp = opeBase.ExecuteNonQuery(ccp, CoreInvokeType.Internal); if (ccp.ReturnCode != -1) { groupJgx = ccp.ReturnObject.ToString(); } return groupJgx; } /// /// 获取热处理优先分组 /// /// /// /// /// /// public static string DefRclGourp(string desginKey, string mscPline, string bom, OpeBase opeBase) { string groupRcl = "200501";//管加工部 CoreClientParam ccp = new CoreClientParam(); ccp.ServerName = "com.steering.pss.plnsaleord.order.baseMethod.CoreDefGourp"; ccp.MethodName = "selectRclDefGroup"; ccp.ServerParams = new object[] { desginKey, mscPline, bom }; ccp = opeBase.ExecuteNonQuery(ccp, CoreInvokeType.Internal); if (ccp.ReturnCode != -1) { groupRcl = ccp.ReturnObject.ToString(); } return groupRcl; } } }