FrmDefGroup.cs 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Data;
  6. using System.Collections;
  7. using CoreFS.CA06;
  8. using Core.Mes.Client.Comm.Server;
  9. namespace Core.StlMes.Client.PlnSaleOrd
  10. {
  11. class FrmDefGroup
  12. {
  13. /// <summary>
  14. /// 计算热处理默认分组
  15. /// </summary>
  16. /// <param name="outdiameter">外径</param>
  17. /// <param name="wallthick">壁厚</param>
  18. /// <param name="lengthmax">长度上限</param>
  19. /// <param name="processC">热处理二级工序</param>
  20. /// <param name="modelCode">扣型</param>
  21. /// <param name="opeBase">平台ob</param>
  22. /// <returns></returns>
  23. public static string defgourpRcl(double outdiameter, double wallthick, double lengthmax,
  24. string processC, string modelCode, OpeBase opeBase)
  25. {
  26. string processStyle = "";
  27. string modelStyle = "";
  28. string groupRcl = "";
  29. //二级工序分类
  30. DataTable dt1 = ServerHelper.GetData("com.steering.pss.plnsaleord.order.baseMethod.CoreDefGourp.queryProcessStyle",
  31. new object[] { processC }, opeBase);
  32. if (dt1 != null && dt1.Rows.Count > 0)
  33. {
  34. processStyle = dt1.Rows[0]["PROCESS_STYLE"].ToString();
  35. }
  36. //扣型分类
  37. DataTable dt2 = ServerHelper.GetData("com.steering.pss.plnsaleord.order.baseMethod.CoreDefGourp.queryModelStyle",
  38. new object[] { modelCode }, opeBase);
  39. if (dt2 != null && dt2.Rows.Count > 0)
  40. {
  41. modelStyle = dt2.Rows[0]["MODEL_STYLE"].ToString();
  42. }
  43. if (lengthmax < 12)
  44. {
  45. //非调质或仅探伤
  46. if (processStyle.Equals("407202") || processStyle.Equals("407203"))
  47. {
  48. if (modelStyle.Equals("405106")) //热轧
  49. {
  50. if (outdiameter < 275 && wallthick < 30)
  51. {
  52. //轧管二部
  53. groupRcl = "200502";
  54. }
  55. }
  56. if (modelStyle.Equals("405101")) //不车丝、倒棱
  57. {
  58. if (outdiameter < 144)
  59. {
  60. //轧管二部
  61. groupRcl = "200502";
  62. }
  63. }
  64. }
  65. }
  66. if (groupRcl.Equals(""))
  67. {
  68. //管加工部
  69. groupRcl = "200501";
  70. }
  71. return groupRcl;
  72. }
  73. /// <summary>
  74. /// 计算加工默认分组
  75. /// </summary>
  76. /// <param name="outdiameter">外径</param>
  77. /// <param name="modelCode">扣型</param>
  78. /// <param name="opeBase">平台ob</param>
  79. /// <returns></returns>
  80. public static string defgourpJgc(double outdiameter, string modelCode, OpeBase opeBase)
  81. {
  82. string modelStyle = "";
  83. string groupJgx = "";
  84. //扣型分类
  85. DataTable dt = ServerHelper.GetData("com.steering.pss.plnsaleord.order.baseMethod.CoreDefGourp.queryModelStyle",
  86. new object[] { modelCode }, opeBase);
  87. if (dt != null && dt.Rows.Count > 0)
  88. {
  89. modelStyle = dt.Rows[0]["MODEL_STYLE"].ToString();
  90. }
  91. if (outdiameter <= 114)
  92. {
  93. if (modelStyle.Equals("405101"))
  94. {
  95. //轧管二部
  96. groupJgx = "200402";
  97. }
  98. if (outdiameter >= 33 && outdiameter <= 114)
  99. {
  100. //热轧
  101. if (modelStyle.Equals("405106"))
  102. {
  103. //轧管二部
  104. groupJgx = "200402";
  105. }
  106. }
  107. }
  108. else if (outdiameter >= 140 && outdiameter <= 273)
  109. {
  110. //热轧
  111. if (modelStyle.Equals("405106"))
  112. {
  113. //轧管二部
  114. groupJgx = "200402";
  115. }
  116. }
  117. if (groupJgx.Equals(""))
  118. {
  119. //管加工部
  120. groupJgx = "200401";
  121. }
  122. return groupJgx;
  123. }
  124. /// <summary>
  125. /// 获取工序评审产线分组
  126. /// </summary>
  127. /// <param name="desginKey">质量设计</param>
  128. /// <param name="mscPline">制程</param>
  129. /// <param name="_ob"></param>
  130. /// <returns></returns>
  131. public static string[] planGroups(string desginKey, string mscPline,string processCode, OpeBase _ob)
  132. {
  133. DataTable dt = ServerHelper.GetData("com.steering.pss.plnsaleord.order.baseMethod.CoreDefGourp.queryProcessPlineGroup",
  134. new object[] { desginKey, mscPline, processCode }, _ob);
  135. if (dt != null && dt.Rows.Count > 0)
  136. {
  137. string[] planGroups = new string[dt.Rows.Count];
  138. for (int i = 0; i < dt.Rows.Count; i++)
  139. {
  140. planGroups[i] = dt.Rows[i]["GROUP_PLAN"].ToString();
  141. }
  142. return planGroups;
  143. }
  144. return null;
  145. }
  146. /// <summary>
  147. /// 计算热处理默认分组
  148. /// </summary>
  149. /// <param name="planGroup">计划分组</param>
  150. /// <param name="outdiameter">外径</param>
  151. /// <param name="wallthick">壁厚</param>
  152. /// <param name="lengthmax">长度上限</param>
  153. /// <param name="processC">热处理二级工序</param>
  154. /// <param name="modelCode">扣型</param>
  155. /// <param name="opeBase">平台ob</param>
  156. /// <returns></returns>
  157. public static string defgourpRcl(string[] planGroups, double outdiameter, double wallthick, double lengthmax,
  158. string processC, string modelCode, OpeBase opeBase)
  159. {
  160. string processStyle = "";
  161. string modelStyle = "";
  162. string groupRcl = "";
  163. //二级工序分类
  164. DataTable dt1 = ServerHelper.GetData("com.steering.pss.plnsaleord.order.baseMethod.CoreDefGourp.queryProcessStyle",
  165. new object[] { processC }, opeBase);
  166. if (dt1 != null && dt1.Rows.Count > 0)
  167. {
  168. processStyle = dt1.Rows[0]["PROCESS_STYLE"].ToString();
  169. }
  170. //扣型分类
  171. DataTable dt2 = ServerHelper.GetData("com.steering.pss.plnsaleord.order.baseMethod.CoreDefGourp.queryModelStyle",
  172. new object[] { modelCode }, opeBase);
  173. if (dt2 != null && dt2.Rows.Count > 0)
  174. {
  175. modelStyle = dt2.Rows[0]["MODEL_STYLE"].ToString();
  176. }
  177. if (lengthmax < 12)
  178. {
  179. //非调质或仅探伤
  180. if (processStyle.Equals("407202") || processStyle.Equals("407203"))
  181. {
  182. if (modelStyle.Equals("405106")) //热轧
  183. {
  184. if (outdiameter < 275 && wallthick < 30)
  185. {
  186. //轧管二部
  187. groupRcl = "200502";
  188. }
  189. }
  190. if (modelStyle.Equals("405101")) //不车丝、倒棱
  191. {
  192. if (outdiameter < 144)
  193. {
  194. //轧管二部
  195. groupRcl = "200502";
  196. }
  197. }
  198. }
  199. }
  200. if (groupRcl.Equals(""))
  201. {
  202. //管加工部
  203. groupRcl = "200501";
  204. }
  205. if (!planGroups.Contains(groupRcl) && planGroups.Count() > 0)
  206. {
  207. groupRcl = planGroups[0];
  208. }
  209. return groupRcl;
  210. }
  211. /// <summary>
  212. /// 计算加工默认分组
  213. /// </summary>
  214. /// <param name="planGroup">计划分组</param>
  215. /// <param name="outdiameter">外径</param>
  216. /// <param name="modelCode">扣型</param>
  217. /// <param name="opeBase">平台ob</param>
  218. /// <returns></returns>
  219. public static string defgourpJgc(string[] planGroups, double outdiameter, string modelCode, OpeBase opeBase)
  220. {
  221. string modelStyle = "";
  222. string groupJgx = "";
  223. //扣型分类
  224. DataTable dt = ServerHelper.GetData("com.steering.pss.plnsaleord.order.baseMethod.CoreDefGourp.queryModelStyle",
  225. new object[] { modelCode }, opeBase);
  226. if (dt != null && dt.Rows.Count > 0)
  227. {
  228. modelStyle = dt.Rows[0]["MODEL_STYLE"].ToString();
  229. }
  230. if (outdiameter <= 114)
  231. {
  232. if (modelStyle.Equals("405101"))
  233. {
  234. //轧管二部
  235. groupJgx = "200402";
  236. }
  237. if (outdiameter >= 33 && outdiameter <= 114)
  238. {
  239. //热轧
  240. if (modelStyle.Equals("405106"))
  241. {
  242. //轧管二部
  243. groupJgx = "200402";
  244. }
  245. }
  246. }
  247. else if (outdiameter >= 140 && outdiameter <= 273)
  248. {
  249. //热轧
  250. if (modelStyle.Equals("405106"))
  251. {
  252. //轧管二部
  253. groupJgx = "200402";
  254. }
  255. }
  256. if (groupJgx.Equals(""))
  257. {
  258. //管加工部
  259. groupJgx = "200401";
  260. }
  261. if (!planGroups.Contains(groupJgx) && planGroups.Count() > 0)
  262. {
  263. groupJgx = planGroups[0];
  264. }
  265. return groupJgx;
  266. }
  267. /// <summary>
  268. /// 获取加工优先分组
  269. /// </summary>
  270. /// <param name="desginKey"></param>
  271. /// <param name="mscPline"></param>
  272. /// <param name="bom"></param>
  273. /// <param name="opeBase"></param>
  274. /// <returns></returns>
  275. public static string DefJgxGourp(string desginKey, string mscPline, string bom, OpeBase opeBase)
  276. {
  277. string groupJgx = "200401";//管加工部
  278. CoreClientParam ccp = new CoreClientParam();
  279. ccp.ServerName = "com.steering.pss.plnsaleord.order.baseMethod.CoreDefGourp";
  280. ccp.MethodName = "selectJgxDefGroup";
  281. ccp.ServerParams = new object[] { desginKey, mscPline, bom };
  282. ccp = opeBase.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  283. if (ccp.ReturnCode != -1)
  284. {
  285. groupJgx = ccp.ReturnObject.ToString();
  286. }
  287. return groupJgx;
  288. }
  289. /// <summary>
  290. /// 获取热处理优先分组
  291. /// </summary>
  292. /// <param name="desginKey"></param>
  293. /// <param name="mscPline"></param>
  294. /// <param name="bom"></param>
  295. /// <param name="opeBase"></param>
  296. /// <returns></returns>
  297. public static string DefRclGourp(string desginKey, string mscPline, string bom, OpeBase opeBase)
  298. {
  299. string groupRcl = "200501";//管加工部
  300. CoreClientParam ccp = new CoreClientParam();
  301. ccp.ServerName = "com.steering.pss.plnsaleord.order.baseMethod.CoreDefGourp";
  302. ccp.MethodName = "selectRclDefGroup";
  303. ccp.ServerParams = new object[] { desginKey, mscPline, bom };
  304. ccp = opeBase.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  305. if (ccp.ReturnCode != -1)
  306. {
  307. groupRcl = ccp.ReturnObject.ToString();
  308. }
  309. return groupRcl;
  310. }
  311. }
  312. }