| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333 |
- 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
- {
- /// <summary>
- /// 计算热处理默认分组
- /// </summary>
- /// <param name="outdiameter">外径</param>
- /// <param name="wallthick">壁厚</param>
- /// <param name="lengthmax">长度上限</param>
- /// <param name="processC">热处理二级工序</param>
- /// <param name="modelCode">扣型</param>
- /// <param name="opeBase">平台ob</param>
- /// <returns></returns>
- 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;
- }
- /// <summary>
- /// 计算加工默认分组
- /// </summary>
- /// <param name="outdiameter">外径</param>
- /// <param name="modelCode">扣型</param>
- /// <param name="opeBase">平台ob</param>
- /// <returns></returns>
- 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;
- }
- /// <summary>
- /// 获取工序评审产线分组
- /// </summary>
- /// <param name="desginKey">质量设计</param>
- /// <param name="mscPline">制程</param>
- /// <param name="_ob"></param>
- /// <returns></returns>
- 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;
- }
- /// <summary>
- /// 计算热处理默认分组
- /// </summary>
- /// <param name="planGroup">计划分组</param>
- /// <param name="outdiameter">外径</param>
- /// <param name="wallthick">壁厚</param>
- /// <param name="lengthmax">长度上限</param>
- /// <param name="processC">热处理二级工序</param>
- /// <param name="modelCode">扣型</param>
- /// <param name="opeBase">平台ob</param>
- /// <returns></returns>
- 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;
- }
- /// <summary>
- /// 计算加工默认分组
- /// </summary>
- /// <param name="planGroup">计划分组</param>
- /// <param name="outdiameter">外径</param>
- /// <param name="modelCode">扣型</param>
- /// <param name="opeBase">平台ob</param>
- /// <returns></returns>
- 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;
- }
- /// <summary>
- /// 获取加工优先分组
- /// </summary>
- /// <param name="desginKey"></param>
- /// <param name="mscPline"></param>
- /// <param name="bom"></param>
- /// <param name="opeBase"></param>
- /// <returns></returns>
- 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;
- }
- /// <summary>
- /// 获取热处理优先分组
- /// </summary>
- /// <param name="desginKey"></param>
- /// <param name="mscPline"></param>
- /// <param name="bom"></param>
- /// <param name="opeBase"></param>
- /// <returns></returns>
- 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;
- }
- }
- }
|