2bb913cfa1a3591bac3cebac69ddbc3786480f8d.svn-base 41 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254
  1. package xin.glue.nui.G.G02;
  2. import java.text.DateFormat;
  3. import java.text.SimpleDateFormat;
  4. import java.util.Calendar;
  5. import java.util.Date;
  6. import java.math.BigDecimal;
  7. import xin.glue.ui.common.PosDateFormat;
  8. import com.posdata.glue.biz.activity.PosActivity;
  9. import com.posdata.glue.biz.constants.PosBizControlConstants;
  10. import com.posdata.glue.biz.control.PosBizControlIF;
  11. import com.posdata.glue.biz.control.PosBizProvider;
  12. import com.posdata.glue.component.PosConstants;
  13. import com.posdata.glue.context.PosContext;
  14. import com.posdata.glue.dao.PosGenericDao;
  15. import com.posdata.glue.dao.vo.PosRowSet;
  16. import com.posdata.glue.dao.vo.PosRow;
  17. import com.posdata.glue.dao.vo.PosParameter;
  18. import com.posdata.glue.msg.PosMESMessageImpl;
  19. import com.posdata.glue.msg.PosMessage;
  20. //import com.sun.org.apache.xpath.internal.operations.Number;
  21. public class XinSaveSlabComm extends PosActivity {
  22. String CurrDate = null;
  23. String OrgOrdNo = null;
  24. String OrgOrdSeq = null;
  25. String CurProcCd = null;
  26. String SlabLoc = null;
  27. String LocDtime = null;
  28. String SlabStat = null;
  29. // String RST_SLAB_CUT_DTIME = null;
  30. String YardLoc = null;
  31. String SlabIngrDec = null;
  32. // Number SLAB_WGT = null;
  33. String sSlabWay = null;
  34. String MillSchStat = null;
  35. String NonordCause = null;
  36. String SLAB_SIZE_DEC_GRD = "1";
  37. Number SP_SLAB_EDT_SEQ = null;
  38. Number SP_CHARGE_SLAB_SEQ = null;
  39. String SP_SLAB_MANA_NO = null;
  40. String SP_PRODNM_CD = null;
  41. String SP_STL_GRD = null;
  42. String SP_SLAB_RT = null;
  43. Number SP_SLAB_THK = null;
  44. Number SP_SLAB_WTH = null;
  45. Number SP_SLAB_LEN = null;
  46. Number SP_SLAB_WGT = null;
  47. String SP_HCR_CLF = null;
  48. String SP_ORD_FL = null;
  49. String SP_ORD_NO = null;
  50. String SP_ORD_SEQ = null;
  51. Number SP_ORD_THK = null;
  52. Number SP_ORD_WTH = null;
  53. Number SP_ORD_LEN = null;
  54. Number SP_ORD_WGT = null;
  55. Number SP_COIL_INDIA = null;
  56. Number SP_COIL_OUTDIA = null;
  57. String SP_ORD_USEAGE_CD = null;
  58. String SP_CUST_CD = null;
  59. String SP_ORDCUST_CD = null;
  60. String SP_SPEC_ABBSYM = null;
  61. String SP_SCARPING_PROC_YN = null;
  62. String SP_MILL_FL = null;
  63. String SP_DSN_SLAB_NO = null;
  64. public String runActivity(PosContext context) {
  65. if(true)return PosBizControlConstants.SUCCESS;
  66. PosParameter param = null;
  67. DateFormat formatter = new SimpleDateFormat("yyyyMMddHHmmss");
  68. CurrDate = formatter.format(new Date());
  69. PosMessage message = context.getMessage();
  70. String MSG_SLAB_NO = (String) message.get("SLAB_NO");
  71. String MSG_PLAN_SLAB_NO = (String) message.get("PLAN_SLAB_NO");
  72. String MSG_CCM_NO = (String) message.get("CCM_NO");
  73. String MSG_STRAND_NO = (String) message.get("STRAND_NO");
  74. String MSG_HCR_CLF = (String) message.get("HCR_CLF");
  75. String MSG_OVER_PLUS_CLF = (String) message.get("OVER_PLUS_CLF");
  76. BigDecimal MSG_SLAB_WGT = (BigDecimal) message.get("SLAB_WGT");
  77. BigDecimal MSG_SLAB_THK = (BigDecimal) message.get("SLAB_THK");
  78. BigDecimal MSG_SLAB_WTH = (BigDecimal) message.get("SLAB_WTH");
  79. BigDecimal MSG_SLAB_LEN = (BigDecimal) message.get("SLAB_LEN");
  80. BigDecimal MSG_SLAB_TEMP = (BigDecimal) message.get("SLAB_TEMP");
  81. String MSG_LAST_CUT_YN = (String) message.get("LAST_CUT_YN");
  82. String MSG_SLAB_CUT_DTIME = (String) message.get("SLAB_CUT_DTIME");
  83. String MSG_SLAB_LOC = (String) message.get("SLAB_LOC");
  84. String ED_DIFF_STL_GRD_STA_END_YN1 = "1";
  85. // 获得计划板坯号
  86. param = new PosParameter();
  87. param.setWhereClauseParameter(0, MSG_SLAB_NO);
  88. PosRowSet rowSet = getDao("mesdao").find("UIG02COMM_PLAN_SLABNO.select", param);
  89. if (rowSet.hasNext()) {
  90. PosRow row = rowSet.next();
  91. MSG_PLAN_SLAB_NO = (String) row.getAttribute("PLAN_SLAB_NO");
  92. }
  93. if (MSG_PLAN_SLAB_NO == null || MSG_PLAN_SLAB_NO.equals("")) {
  94. MSG_PLAN_SLAB_NO = "3" + MSG_SLAB_NO.substring(1,10) + "010";
  95. }
  96. // get shift group info
  97. String sShift = null;
  98. if (MSG_SLAB_CUT_DTIME == null || MSG_SLAB_CUT_DTIME.equals("")) {
  99. MSG_SLAB_CUT_DTIME = CurrDate;
  100. }
  101. PosDateFormat dateFormat = new PosDateFormat();
  102. sShift = dateFormat.getShift(MSG_SLAB_CUT_DTIME);
  103. PosParameter paramS = new PosParameter();
  104. paramS.setWhereClauseParameter(0, MSG_SLAB_CUT_DTIME.substring(0, 6));
  105. paramS.setWhereClauseParameter(1, MSG_SLAB_CUT_DTIME.substring(6, 8));
  106. paramS.setWhereClauseParameter(2, sShift);
  107. paramS.setWhereClauseParameter(3, "S");
  108. PosRowSet groupVO = this.getDao("mesdao").find("NIG020210_SHIFT.select", paramS);
  109. String sGroup = null;
  110. if (groupVO.hasNext()) {
  111. PosRow groupROW = groupVO.next();
  112. sGroup = (String) groupROW.getAttribute("GR_GROUP_CD");
  113. }
  114. // Slab Spec(TBF01_SPEC_SLAB ) editing
  115. SlabSpecEdit(MSG_PLAN_SLAB_NO);
  116. OrgOrdNo = SP_ORD_NO;
  117. OrgOrdSeq = SP_ORD_SEQ;
  118. MSG_HCR_CLF = SP_HCR_CLF;
  119. // Calculation Slab Weight
  120. if (MSG_SLAB_WGT == null || MSG_SLAB_WGT.intValue() == 0) {
  121. MSG_SLAB_WGT = calWgt(MSG_SLAB_THK, MSG_SLAB_WTH, MSG_SLAB_LEN);
  122. }
  123. // Slab Size Decision
  124. // SLAB SIZE DECISION CALL AT THAT TIME SLAB WEIGHTING
  125. if (!MSG_OVER_PLUS_CLF.equals("S") && MSG_SLAB_LOC != null && !MSG_SLAB_WGT.equals(new BigDecimal(0)) &&
  126. (MSG_SLAB_LOC.equals("5") || MSG_SLAB_LOC.equals("2") || MSG_SLAB_LOC.equals("4"))
  127. && SP_SLAB_RT != null && !(SP_SLAB_RT.equals("P") || SP_SLAB_RT.equals("Z"))) {
  128. String RtnSizeDec = SlabSizeDec(MSG_SLAB_THK, MSG_SLAB_WTH,MSG_SLAB_LEN, MSG_SLAB_NO, MSG_PLAN_SLAB_NO, MSG_SLAB_WGT);
  129. if (RtnSizeDec.equals("N")) {
  130. SLAB_SIZE_DEC_GRD = "2";
  131. }else{
  132. SLAB_SIZE_DEC_GRD = "1";
  133. }
  134. }
  135. // SLAB ROUTE PLATE --> "RGB" SET TO PROG_CD
  136. // SLAB ROUTE HOT COIL,COIL COIL --> "RBA" SET TO PROG_CD
  137. String p_slab_status = null;
  138. // Plate Slab Setting : PROG_CD, and TBD01_SLABDN update
  139. String PlatSlab = "N";
  140. // Slab Comm Select
  141. String sql = "select * from TBG02_SLAB_COMM where SLAB_NO = ?";
  142. PosParameter paramv = new PosParameter();
  143. paramv.setWhereClauseParameter(0, MSG_SLAB_NO);
  144. PosRowSet SlabCommVo = getDao("mesdao").findByQueryStatement(sql,paramv);
  145. if (SlabCommVo.hasNext()) {
  146. PosRow SlabCommROW = SlabCommVo.next();
  147. SlabLoc = (String) SlabCommROW.getAttribute("CUR_LOAD_LOC");
  148. LocDtime = (String) SlabCommROW.getAttribute("CUR_LOAD_LOC_DTIME");
  149. SlabStat = (String) SlabCommROW.getAttribute("SLAB_STAT");
  150. SlabIngrDec = (String) SlabCommROW.getAttribute("SLAB_INGR_DEC_GRD");
  151. CurProcCd = (String) SlabCommROW.getAttribute("CUR_PROG_CD");
  152. String SLAB_CUT_DTIME = (String) SlabCommROW.getAttribute("SLAB_CUT_DTIME");
  153. if (SLAB_CUT_DTIME != null && !SLAB_CUT_DTIME.equals("")) {
  154. MSG_SLAB_CUT_DTIME = SLAB_CUT_DTIME;
  155. }
  156. // 中厚板区分
  157. PlatSlab = isPlatSlab(SP_SLAB_RT);
  158. // 是否回送
  159. if (PlatSlab.equals("Y")) {
  160. if (SlabIngrDec == null
  161. || !SlabIngrDec.equals("1")
  162. || (SLAB_SIZE_DEC_GRD != null && SLAB_SIZE_DEC_GRD
  163. .equals("2"))) {
  164. p_slab_status = "01";
  165. } else {
  166. p_slab_status = "05";
  167. }
  168. if (SP_DSN_SLAB_NO != null) {
  169. PosParameter paramV = new PosParameter();
  170. // reject
  171. paramV.setWhereClauseParameter(0, p_slab_status);
  172. paramV.setWhereClauseParameter(1, SP_DSN_SLAB_NO);
  173. this.getDao("mesdao").update(
  174. "NIG020610_TBD01_SLABDN.update", paramV);
  175. }
  176. }
  177. // 订单 物料进程判断
  178. if (PlatSlab.equals("Y")) {
  179. // Plate Slab PROG_CD SET
  180. CurProcCd = "RGB";
  181. SP_ORD_NO = null;
  182. SP_ORD_SEQ = null;
  183. }else if(MSG_OVER_PLUS_CLF.equals("S")){
  184. CurProcCd = "RRC";
  185. SP_ORD_NO = null;
  186. SP_ORD_SEQ = null;
  187. NonordCause = "2D";
  188. MSG_HCR_CLF = "C";
  189. SP_ORD_FL = "2";
  190. } else if (SlabIngrDec == null || SlabIngrDec.equals("2")
  191. || ED_DIFF_STL_GRD_STA_END_YN1.equals("2")) {
  192. // Chemistry Decision chek and PROG_CD SET
  193. CurProcCd = "RAB";
  194. SP_ORD_NO = OrgOrdNo;
  195. SP_ORD_SEQ = OrgOrdSeq;
  196. NonordCause = "";
  197. MSG_HCR_CLF = "C";
  198. SP_ORD_FL = "1";
  199. } else if (SLAB_SIZE_DEC_GRD.equals("2")) {
  200. // Slab Size Decision and PROG_CD SET
  201. CurProcCd = "RRC";
  202. SP_ORD_NO = null;
  203. SP_ORD_SEQ = null;
  204. NonordCause = "3C";
  205. MSG_HCR_CLF = "C";
  206. SP_ORD_FL = "2";
  207. } else if (SP_ORD_FL != null && SP_ORD_FL.equals("2")) {
  208. // 计划余才
  209. CurProcCd = "RRC";
  210. SP_ORD_NO = null;
  211. SP_ORD_SEQ = null;
  212. NonordCause = "1A";
  213. MSG_HCR_CLF = "C";
  214. SP_ORD_FL = "2";
  215. } else if (SP_HCR_CLF != null && SP_HCR_CLF.equals("H")&& SP_MILL_FL.equals("Y")) {
  216. CurProcCd = "RBB";
  217. SP_ORD_NO = OrgOrdNo;
  218. SP_ORD_SEQ = OrgOrdSeq;
  219. NonordCause = "";
  220. MSG_HCR_CLF = "H";
  221. SP_ORD_FL = "1";
  222. MillSchStat = "";
  223. } else {
  224. CurProcCd = "RBA";
  225. SP_ORD_NO = OrgOrdNo;
  226. SP_ORD_SEQ = OrgOrdSeq;
  227. NonordCause = "";
  228. MSG_HCR_CLF = "C";
  229. SP_ORD_FL = "1";
  230. }
  231. // sSlabWay =
  232. // DecSlabWay(MSG_SLAB_NO,MSG_HCR_CLF,SP_SLAB_RT,SP_SCARPING_PROC_YN);
  233. if (CurProcCd == null || CurProcCd.equals("")) {
  234. CurProcCd = "JJB";
  235. }
  236. if (SlabLoc != null
  237. && (SlabLoc.substring(0, 1).equals("Z") || SlabLoc
  238. .substring(0, 1).equals("L"))) {
  239. YardLoc = SlabLoc;
  240. LocDtime = MSG_SLAB_CUT_DTIME;
  241. } else {
  242. if (MSG_CCM_NO != null && MSG_CCM_NO.equals("J2")) {
  243. SlabLoc = "C0";
  244. YardLoc = "C0";
  245. } else {
  246. SlabLoc = "A0";
  247. YardLoc = "A0";
  248. }
  249. LocDtime = MSG_SLAB_CUT_DTIME;
  250. }
  251. if (NonordCause != null && NonordCause.equals("2D")) {
  252. MSG_HCR_CLF = "C";
  253. SP_ORD_FL = "2";
  254. }
  255. PosParameter param1 = new PosParameter();
  256. param1.setValueParamter(0, CurProcCd);
  257. param1.setValueParamter(1, SP_ORD_NO);
  258. param1.setValueParamter(2, SP_ORD_SEQ);
  259. param1.setValueParamter(3, SP_ORD_FL);
  260. param1.setValueParamter(4, SP_STL_GRD);
  261. param1.setValueParamter(5, SP_PRODNM_CD);
  262. param1.setValueParamter(6, SP_CUST_CD);
  263. param1.setValueParamter(7, SP_ORD_USEAGE_CD);
  264. param1.setValueParamter(8, SP_SPEC_ABBSYM);
  265. param1.setValueParamter(9, SP_SLAB_THK); //指示规格
  266. param1.setValueParamter(10, SP_SLAB_WTH);
  267. param1.setValueParamter(11, SP_SLAB_LEN);
  268. param1.setValueParamter(12, SP_SLAB_WGT);
  269. param1.setValueParamter(13, MSG_HCR_CLF);
  270. param1.setValueParamter(14, SP_ORDCUST_CD);
  271. param1.setValueParamter(15, MSG_SLAB_THK);
  272. param1.setValueParamter(16, MSG_SLAB_WTH);
  273. param1.setValueParamter(17, MSG_SLAB_LEN);
  274. param1.setValueParamter(18, MSG_SLAB_WGT);
  275. param1.setValueParamter(19, MSG_SLAB_TEMP);
  276. param1.setValueParamter(20, MSG_SLAB_CUT_DTIME);
  277. param1.setValueParamter(21, MSG_LAST_CUT_YN);
  278. param1.setValueParamter(22, MSG_OVER_PLUS_CLF);
  279. param1.setValueParamter(23, SP_HCR_CLF);
  280. param1.setValueParamter(24, MSG_STRAND_NO);
  281. param1.setValueParamter(25, sSlabWay);
  282. param1.setValueParamter(26, SP_SLAB_RT);
  283. param1.setValueParamter(27, MSG_SLAB_WGT);
  284. param1.setValueParamter(28, SlabLoc);
  285. param1.setValueParamter(29, LocDtime);
  286. param1.setValueParamter(30, SP_SLAB_THK);
  287. param1.setValueParamter(31, SP_SLAB_WTH);
  288. param1.setValueParamter(32, SP_SLAB_LEN);
  289. param1.setValueParamter(33, SP_SLAB_WGT);
  290. param1.setValueParamter(34, sShift);
  291. param1.setValueParamter(35, sGroup);
  292. param1.setValueParamter(36, MSG_CCM_NO);
  293. param1.setValueParamter(37, OrgOrdNo);
  294. param1.setValueParamter(38, OrgOrdSeq);
  295. param1.setValueParamter(39, NonordCause);
  296. param1.setValueParamter(40, MillSchStat);
  297. param1.setValueParamter(41, SLAB_SIZE_DEC_GRD);
  298. param1.setValueParamter(42, ED_DIFF_STL_GRD_STA_END_YN1);
  299. param1.setValueParamter(43, SP_ORD_THK);
  300. param1.setValueParamter(44, SP_ORD_WTH);
  301. param1.setValueParamter(45, MSG_SLAB_NO);
  302. this.getDao("mesdao").update("NIG020610_SLAB_COMM.update", param1);
  303. setSlabCommD(MSG_SLAB_NO, MSG_SLAB_WGT, SP_ORD_FL, SP_ORD_NO, SP_ORD_SEQ,
  304. SP_ORD_THK, SP_ORD_WTH);
  305. // 切割事件
  306. if (SlabStat != null && SlabStat.equals("1")) {
  307. PosParameter param8 = new PosParameter();
  308. String ProcCd = null;
  309. if (MSG_CCM_NO != null && MSG_CCM_NO.equals("J1")) {
  310. ProcCd = "S1";
  311. } else {
  312. ProcCd = "S2";
  313. }
  314. param8.setValueParamter(0, "");
  315. param8.setValueParamter(1, MSG_SLAB_NO.substring(0, 10));
  316. param8.setValueParamter(2, SP_STL_GRD);
  317. param8.setValueParamter(3, "");
  318. param8.setValueParamter(4, "");
  319. param8.setValueParamter(5, "");
  320. param8.setValueParamter(6, "");
  321. param8.setValueParamter(7, "");
  322. param8.setValueParamter(8, ProcCd);
  323. this.getDao("mesdao").insert("NIG020200_SMS_TRACK.update",
  324. param8);
  325. }
  326. } else {
  327. String InstrOrdFl = SP_ORD_FL;
  328. // 中厚板区分
  329. PlatSlab = isPlatSlab(SP_SLAB_RT);
  330. if (PlatSlab.equals("Y")) {
  331. CurProcCd = "RGB";
  332. } else {
  333. CurProcCd = "RRC";
  334. SP_ORD_NO = null;
  335. SP_ORD_SEQ = null;
  336. NonordCause = "2D";
  337. MSG_HCR_CLF = "C";
  338. SP_ORD_FL = "2";
  339. }
  340. // CURRENT LOCATION SETTING
  341. // if MC_NO = '1' then "A0" set to CUR_LOAD_LOC culumn of
  342. // tbg02_slab_comm
  343. // else set "C0" to CUR_LOAD_LOC culumn of tbg02_slab_comm
  344. if (MSG_CCM_NO != null && MSG_CCM_NO.equals("J2")) {
  345. SlabLoc = "C0";
  346. YardLoc = "C0";
  347. } else {
  348. SlabLoc = "A0";
  349. YardLoc = "A0";
  350. }
  351. String sFSlabNo = MSG_SLAB_NO.substring(0, 10) + "010";
  352. String Fslabsql = "select SLAB_INGR_DEC_GRD,SLAB_INGR_DEC_KIND from TBG02_SLAB_COMM where SLAB_NO = ?";
  353. PosParameter paramY = new PosParameter();
  354. paramY.setWhereClauseParameter(0, sFSlabNo);
  355. PosRowSet fstSlabVo = getDao("mesdao").findByQueryStatement(Fslabsql, paramY);
  356. String IngDec = null;
  357. String IngDecKnd = null;
  358. if (fstSlabVo.hasNext()) {
  359. PosRow fstSlabVoROW = fstSlabVo.next();
  360. IngDec = (String) fstSlabVoROW.getAttribute("SLAB_INGR_DEC_GRD");
  361. IngDecKnd = (String) fstSlabVoROW.getAttribute("SLAB_INGR_DEC_KIND");
  362. }
  363. PosParameter param2 = new PosParameter();
  364. param2.setValueParamter(0, MSG_SLAB_NO);
  365. param2.setValueParamter(1, MSG_PLAN_SLAB_NO);
  366. param2.setValueParamter(2, "2");
  367. param2.setValueParamter(3, CurProcCd);
  368. param2.setValueParamter(4, "XinSaveSlabComm");
  369. param2.setValueParamter(5, CurrDate);
  370. param2.setValueParamter(6, SP_ORD_NO);
  371. param2.setValueParamter(7, SP_ORD_SEQ);
  372. param2.setValueParamter(8, SP_ORD_FL);
  373. param2.setValueParamter(9, SP_STL_GRD);
  374. param2.setValueParamter(10, SP_PRODNM_CD);
  375. param2.setValueParamter(11, SP_CUST_CD);
  376. param2.setValueParamter(12, SP_ORD_USEAGE_CD);
  377. param2.setValueParamter(13, SP_SPEC_ABBSYM);
  378. param2.setValueParamter(14, SP_SLAB_THK);
  379. param2.setValueParamter(15, SP_SLAB_WTH);
  380. param2.setValueParamter(16, SP_SLAB_LEN);
  381. param2.setValueParamter(17, SP_SLAB_WGT);
  382. param2.setValueParamter(18, MSG_HCR_CLF);
  383. param2.setValueParamter(19, SP_ORDCUST_CD);
  384. param2.setValueParamter(20, MSG_SLAB_THK);
  385. param2.setValueParamter(21, MSG_SLAB_WTH);
  386. param2.setValueParamter(22, MSG_SLAB_LEN);
  387. param2.setValueParamter(23, MSG_SLAB_WGT);
  388. param2.setValueParamter(24, MSG_SLAB_TEMP);
  389. param2.setValueParamter(25, MSG_SLAB_CUT_DTIME);
  390. param2.setValueParamter(26, MSG_LAST_CUT_YN);
  391. param2.setValueParamter(27, MSG_OVER_PLUS_CLF);
  392. param2.setValueParamter(28, SP_HCR_CLF);
  393. param2.setValueParamter(29, MSG_STRAND_NO);
  394. param2.setValueParamter(30, ED_DIFF_STL_GRD_STA_END_YN1);
  395. param2.setValueParamter(31, sSlabWay);
  396. param2.setValueParamter(32, SP_SLAB_RT);
  397. param2.setValueParamter(33, MSG_SLAB_WGT);
  398. param2.setValueParamter(34, SlabLoc);
  399. param2.setValueParamter(35, MSG_SLAB_CUT_DTIME);
  400. param2.setValueParamter(36, SP_SLAB_THK);
  401. param2.setValueParamter(37, SP_SLAB_WTH);
  402. param2.setValueParamter(38, SP_SLAB_LEN);
  403. param2.setValueParamter(39, SP_SLAB_WGT);
  404. param2.setValueParamter(40, sShift);
  405. param2.setValueParamter(41, sGroup);
  406. param2.setValueParamter(42, InstrOrdFl);
  407. param2.setValueParamter(43, NonordCause);
  408. param2.setValueParamter(44, MSG_CCM_NO);
  409. param2.setValueParamter(45, OrgOrdNo);
  410. param2.setValueParamter(46, OrgOrdSeq);
  411. param2.setValueParamter(47, MillSchStat);
  412. param2.setValueParamter(48, SLAB_SIZE_DEC_GRD);
  413. param2.setValueParamter(49, IngDec);
  414. param2.setValueParamter(50, IngDecKnd);
  415. this.getDao("mesdao").update("NIG020610_SLAB_COMM.insert", param2);
  416. PosParameter param5 = new PosParameter();
  417. param5.setWhereClauseParameter(0, SP_SLAB_EDT_SEQ);
  418. PosRowSet SlabSpecDVo = getDao("mesdao").find("NIG020610_SPEC_SLAB_D.select", param5);
  419. while (SlabSpecDVo.hasNext()) {
  420. PosRow SlabSpecDROW = SlabSpecDVo.next();
  421. String D_SLAB_CUT_SEQ = (String) SlabSpecDROW.getAttribute("SLAB_CUT_SEQ");
  422. Number D_SLAB_THK = (Number) SlabSpecDROW.getAttribute("SLAB_THK");
  423. Number D_SLAB_WTH = (Number) SlabSpecDROW.getAttribute("SLAB_WTH");
  424. Number D_SLAB_LEN = (Number) SlabSpecDROW.getAttribute("SLAB_LEN");
  425. Number D_ORD_THK = (Number) SlabSpecDROW.getAttribute("ORD_THK");
  426. Number D_ORD_WTH = (Number) SlabSpecDROW.getAttribute("ORD_WTH");
  427. Number D_ORD_LEN = (Number) SlabSpecDROW.getAttribute("ORD_LEN");
  428. Number D_ORD_WGT = (Number) SlabSpecDROW.getAttribute("ORD_WGT");
  429. Number D_COIL_INDIA = (Number) SlabSpecDROW.getAttribute("COIL_INDIA");
  430. Number D_COIL_OUTDIA = (Number) SlabSpecDROW.getAttribute("COIL_OUTDIA");
  431. String D_ORD_NO = (String) SlabSpecDROW.getAttribute("ORD_NO");
  432. String D_ORD_SEQ = (String) SlabSpecDROW.getAttribute("ORD_SEQ");
  433. String D_ORD_FL = (String) SlabSpecDROW.getAttribute("ORD_FL");
  434. PosParameter param6 = new PosParameter();
  435. param6.setValueParamter(0, MSG_SLAB_NO);
  436. param6.setValueParamter(1, D_SLAB_CUT_SEQ);
  437. param6.setValueParamter(2, D_SLAB_THK);
  438. param6.setValueParamter(3, D_SLAB_WTH);
  439. param6.setValueParamter(4, D_SLAB_LEN);
  440. param6.setValueParamter(5, D_ORD_THK);
  441. param6.setValueParamter(6, D_ORD_WTH);
  442. param6.setValueParamter(7, D_ORD_LEN);
  443. param6.setValueParamter(8, D_ORD_WGT);
  444. param6.setValueParamter(9, D_COIL_INDIA);
  445. param6.setValueParamter(10, D_COIL_OUTDIA);
  446. param6.setValueParamter(11, D_ORD_NO);
  447. param6.setValueParamter(12, D_ORD_SEQ);
  448. param6.setValueParamter(13, "2");
  449. this.getDao("mesdao").update("NIG020610_SLAB_COMM_D.insert",param6);
  450. }
  451. PosParameter paramz = new PosParameter();
  452. String ProcCd = null;
  453. if (MSG_CCM_NO != null && MSG_CCM_NO.equals("J1")) {
  454. ProcCd = "S1";
  455. } else {
  456. ProcCd = "S2";
  457. }
  458. paramz.setValueParamter(0, "");
  459. paramz.setValueParamter(1, MSG_SLAB_NO.substring(0, 10));
  460. paramz.setValueParamter(2, SP_STL_GRD);
  461. paramz.setValueParamter(3, "");
  462. paramz.setValueParamter(4, "");
  463. paramz.setValueParamter(5, "");
  464. paramz.setValueParamter(6, "");
  465. paramz.setValueParamter(7, "");
  466. paramz.setValueParamter(8, ProcCd);
  467. this.getDao("mesdao").insert("NIG020200_SMS_TRACK.update", paramz);
  468. }
  469. // if (MSG_SLAB_LOC != null
  470. // && (MSG_SLAB_LOC.equals("5") || MSG_SLAB_LOC.equals("6"))) {
  471. // if (MSG_OVER_PLUS_CLF == null || MSG_OVER_PLUS_CLF.equals("")) {
  472. // SendProg_NIE012070(MSG_SLAB_NO, SP_ORD_NO, SP_ORD_SEQ, SP_ORD_NO,SP_ORD_SEQ, CurProcCd, "", "TM", MSG_SLAB_WGT);
  473. // }
  474. // }
  475. String RejKind = null;
  476. // Mill Scheduling slab check and 'H'->'C' check and send to Mill
  477. // Scheduling reject request
  478. if (SP_MILL_FL != null && SP_MILL_FL.equals("Y")) {
  479. if (SLAB_SIZE_DEC_GRD.equals("2")) {
  480. RejKind = "Z";
  481. SendProg_NIF024060(MSG_SLAB_NO, RejKind);
  482. } else if ((SlabIngrDec != null && SlabIngrDec.equals("2"))|| (SP_HCR_CLF.equals("H") && MSG_HCR_CLF.equals("C"))) {
  483. RejKind = "M";
  484. SendProg_NIF024060(MSG_SLAB_NO, RejKind);
  485. }
  486. }
  487. PosParameter paramA = new PosParameter();
  488. paramA.setWhereClauseParameter(0, MSG_PLAN_SLAB_NO);
  489. PosRowSet SpecChVo = getDao("mesdao").find(
  490. "NIG020610_SLAB_SPEC.select", paramA);
  491. while (SpecChVo.hasNext()) {
  492. PosRow SpecChROW = SpecChVo.next();
  493. Number nSlabEdtSeq = (Number) SpecChROW
  494. .getAttribute("SLAB_EDT_SEQ");
  495. String SlabManaNo = (String) SpecChROW.getAttribute("SLAB_MANA_NO");
  496. PosParameter param7 = new PosParameter();
  497. param7.setValueParamter(0, "C");
  498. param7.setValueParamter(1, SlabManaNo);
  499. this.getDao("mesdao").update("NIG020610_SPEC_SLAB.update", param7);
  500. PosParameter param8 = new PosParameter();
  501. param8.setValueParamter(0, "C");
  502. param8.setValueParamter(1, nSlabEdtSeq);
  503. this.getDao("mesdao")
  504. .update("NIG020610_SPEC_SLAB_D.update", param8);
  505. }
  506. String chargcomm = "SELECT CUR_PROG_CD,BEF_PROG_CD,CHARGE_WGT FROM TBG02_CHARGE_COMM WHERE CHARGE_NO = ? ";
  507. PosParameter param0 = new PosParameter();
  508. param0.setWhereClauseParameter(0, MSG_SLAB_NO.substring(0, 10));
  509. PosRowSet ChVO = this.getDao("mesdao").findByQueryStatement(chargcomm,
  510. param0);
  511. String PR_BEF_PROG_CD = null;
  512. Number PR_CHARGE_WGT = null;
  513. if (ChVO.hasNext()) {
  514. PosRow ChROW = ChVO.next();
  515. PR_BEF_PROG_CD = (String) ChROW.getAttribute("BEF_PROG_CD");
  516. PR_CHARGE_WGT = (Number) ChROW.getAttribute("CHARGE_WGT");
  517. }
  518. if (MSG_SLAB_LOC != null
  519. && (MSG_SLAB_LOC.equals("5") || MSG_SLAB_LOC.equals("6"))) {
  520. if (MSG_OVER_PLUS_CLF == null || MSG_OVER_PLUS_CLF.equals("")) {
  521. SendProg_NIE012070(MSG_PLAN_SLAB_NO.substring(0, 10), "", "","", "", "JJB", PR_BEF_PROG_CD, "CH", PR_CHARGE_WGT);
  522. }
  523. }
  524. // Last slab check and the set end mark to charge master and spec
  525. // slab,spec charge
  526. if (MSG_LAST_CUT_YN != null && MSG_LAST_CUT_YN.equals("E")) {
  527. LastSlabCut(MSG_SLAB_NO, MSG_PLAN_SLAB_NO, SP_MILL_FL, SP_SLAB_RT,SP_DSN_SLAB_NO);
  528. SendProg_NIE012070(MSG_PLAN_SLAB_NO.substring(0, 10), "", "", "","", "JJB", PR_BEF_PROG_CD, "CH", PR_CHARGE_WGT);
  529. }
  530. SendProg_NIE012080();
  531. // yard map update
  532. if (YardLoc != null && (YardLoc.equals("A0") || YardLoc.equals("C0"))) {
  533. PosParameter param13 = new PosParameter();
  534. param13.setWhereClauseParameter(0, MSG_SLAB_NO);
  535. param13.setWhereClauseParameter(1, SlabLoc);
  536. PosRowSet slabExistVo = getDao("mesdao").find("NIG020610_YARD_SLAB_EXIST.select", param13);
  537. if (!slabExistVo.hasNext()) {
  538. PosParameter param15 = new PosParameter();
  539. param15.setWhereClauseParameter(0, SlabLoc);
  540. param15.setWhereClauseParameter(1, MSG_SLAB_NO);
  541. PosRowSet YardMapVo = getDao("mesdao").find("NIG020610_YARD.select", param15);
  542. while (YardMapVo.hasNext()) {
  543. PosRow YardMapROW = YardMapVo.next();
  544. String YARD_ADDR = (String) YardMapROW.getAttribute("YARD_ADDR");
  545. String YARD_LAY = (String) YardMapROW.getAttribute("YARD_LAY");
  546. String SLAB_NO = (String) YardMapROW.getAttribute("SLAB_NO");
  547. String LINE_ADDR = YARD_ADDR + YARD_LAY;
  548. PosParameter param16 = new PosParameter();
  549. param16.setValueParamter(0, SLAB_NO);
  550. param16.setValueParamter(1, LINE_ADDR);
  551. this.getDao("mesdao").update("NIG020610_YARD.update",param16);
  552. }
  553. String UpdLoc = YardLoc + "01";
  554. PosParameter param14 = new PosParameter();
  555. param14.setValueParamter(0, MSG_SLAB_NO);
  556. param14.setValueParamter(1, UpdLoc);
  557. this.getDao("mesdao").update("NIG020610_YARD.update", param14);
  558. }
  559. }
  560. // if (MSG_SLAB_LOC != null && (MSG_SLAB_LOC.equals("5") || MSG_SLAB_LOC.equals("6"))) {
  561. // SendProg_NIG020640(MSG_SLAB_NO, SP_STL_GRD, MSG_SLAB_LOC);
  562. // }
  563. // if (MSG_SLAB_LOC != null && MSG_SLAB_LOC.equals("6")) {
  564. // updateRHFL1(MSG_SLAB_NO, MSG_HCR_CLF);
  565. // }
  566. return PosBizControlConstants.SUCCESS;
  567. }
  568. public void setSlabCommD(String SlabNo, Number SlabWgt, String OrdFl,
  569. String ordNo, String ordSeq, Number ordThk, Number ordWth) {
  570. PosParameter paramz = new PosParameter();
  571. paramz.setValueParamter(0, OrdFl);
  572. paramz.setValueParamter(1, ordNo);
  573. paramz.setValueParamter(2, ordSeq);
  574. paramz.setValueParamter(3, ordThk);
  575. paramz.setValueParamter(4, ordWth);
  576. paramz.setValueParamter(5, SlabNo);
  577. this.getDao("mesdao").update("NIG020610_SLAB_COMM_D.update", paramz);
  578. }
  579. public void SlabSpecEdit(String PlanSlabNo) {
  580. PosParameter param = new PosParameter();
  581. param.setWhereClauseParameter(0, PlanSlabNo);
  582. PosRowSet SlabSpecVo = getDao("mesdao").find(
  583. "NIG020610_SLAB_SPEC.select", param);
  584. if (SlabSpecVo.hasNext()) {
  585. PosRow SlabSpecRow = SlabSpecVo.next();
  586. SP_SLAB_EDT_SEQ = (Number) SlabSpecRow.getAttribute("SLAB_EDT_SEQ");
  587. SP_CHARGE_SLAB_SEQ = (Number) SlabSpecRow
  588. .getAttribute("CHARGE_SLAB_SEQ");
  589. SP_SLAB_MANA_NO = (String) SlabSpecRow.getAttribute("SLAB_MANA_NO");
  590. SP_PRODNM_CD = (String) SlabSpecRow.getAttribute("PRODNM_CD");
  591. SP_STL_GRD = (String) SlabSpecRow.getAttribute("STL_GRD");
  592. SP_SLAB_RT = (String) SlabSpecRow.getAttribute("SLAB_RT");
  593. SP_SLAB_THK = (Number) SlabSpecRow.getAttribute("SLAB_THK");
  594. SP_SLAB_WTH = (Number) SlabSpecRow.getAttribute("SLAB_WTH");
  595. SP_SLAB_LEN = (Number) SlabSpecRow.getAttribute("SLAB_LEN");
  596. SP_SLAB_WGT = (Number) SlabSpecRow.getAttribute("SLAB_WGT");
  597. SP_HCR_CLF = (String) SlabSpecRow.getAttribute("HCR_CLF");
  598. SP_ORD_FL = (String) SlabSpecRow.getAttribute("ORD_FL");
  599. SP_ORD_NO = (String) SlabSpecRow.getAttribute("ORD_NO");
  600. SP_ORD_SEQ = (String) SlabSpecRow.getAttribute("ORD_SEQ");
  601. SP_ORD_THK = (Number) SlabSpecRow.getAttribute("ORD_THK");
  602. SP_ORD_WTH = (Number) SlabSpecRow.getAttribute("ORD_WTH");
  603. SP_ORD_LEN = (Number) SlabSpecRow.getAttribute("ORD_LEN");
  604. SP_ORD_WGT = (Number) SlabSpecRow.getAttribute("ORD_WGT");
  605. SP_COIL_INDIA = (Number) SlabSpecRow.getAttribute("COIL_INDIA");
  606. SP_COIL_OUTDIA = (Number) SlabSpecRow.getAttribute("COIL_OUTDIA");
  607. SP_ORD_USEAGE_CD = (String) SlabSpecRow
  608. .getAttribute("ORD_USEAGE_CD");
  609. SP_CUST_CD = (String) SlabSpecRow.getAttribute("CUST_CD");
  610. SP_ORDCUST_CD = (String) SlabSpecRow.getAttribute("ORDCUST_CD");
  611. SP_SPEC_ABBSYM = (String) SlabSpecRow.getAttribute("SPEC_ABBSYM");
  612. SP_SCARPING_PROC_YN = (String) SlabSpecRow
  613. .getAttribute("SCARPING_PROC_YN");
  614. SP_MILL_FL = (String) SlabSpecRow.getAttribute("MILL_FL");
  615. SP_DSN_SLAB_NO = (String) SlabSpecRow.getAttribute("DSN_SLAB_NO");
  616. }
  617. }
  618. public BigDecimal calWgt(BigDecimal SlabThk, BigDecimal SlabWth,
  619. BigDecimal Slab_Len) {
  620. BigDecimal SLAB_WGT = new BigDecimal(0);
  621. if (SlabThk != null && SlabWth != null && Slab_Len != null) {
  622. PosParameter paramP = new PosParameter();
  623. paramP.setWhereClauseParameter(0, SlabThk);
  624. paramP.setWhereClauseParameter(1, SlabWth);
  625. paramP.setWhereClauseParameter(2, Slab_Len);
  626. PosRowSet CalWgtVo = getDao("mesdao").findByQueryStatement(
  627. "UIG02COMM_CACUL_SLAB_WGT.select", paramP);
  628. if (CalWgtVo.hasNext()) {
  629. PosRow CalWgtROW = CalWgtVo.next();
  630. SLAB_WGT = (BigDecimal) CalWgtROW.getAttribute("CAL_WGT");
  631. }
  632. }
  633. return SLAB_WGT;
  634. }
  635. public String isPlatSlab(String SlabRt) {
  636. String RtCd = null;
  637. if (SlabRt != null && (SlabRt.equals("P") || SlabRt.equals("Z"))) {
  638. RtCd = "Y";
  639. } else {
  640. RtCd = "N";
  641. }
  642. return RtCd;
  643. }
  644. public void LastSlabCut(String SlabNo, String PlanSlabNo, String MillFl,
  645. String SlabRt, String DsnSlabNo) {
  646. PosParameter param9 = new PosParameter();
  647. param9.setValueParamter(0, "C");
  648. param9.setValueParamter(1, "JJB");
  649. param9.setValueParamter(2, "3" + SlabNo.substring(1, 10));
  650. this.getDao("mesdao").update("NIG020610_SPEC_CHARGE.update", param9);
  651. PosParameter param10 = new PosParameter();
  652. param10.setValueParamter(0, "C");
  653. param10.setValueParamter(1, "3" + SlabNo.substring(1, 10));
  654. this.getDao("mesdao").update("NIG020610_SPEC_CHARGE_IDX.update",
  655. param10);
  656. PosParameter param11 = new PosParameter();
  657. param11.setValueParamter(0, "3");
  658. param11.setValueParamter(1, "JJB");
  659. param11.setValueParamter(2, "NIG020610");
  660. param11.setValueParamter(3, SlabNo.substring(0, 10));
  661. this.getDao("mesdao").update("NIG020610_CHARGE_COMM.update", param11);
  662. PosParameter param12 = new PosParameter();
  663. param12.setValueParamter(0, "3");
  664. param12.setValueParamter(1, SlabNo.substring(0, 10));
  665. this.getDao("mesdao").update("NIG020610_STLMAKE_PROG.update", param12);
  666. // if slab cutting result less than slab schedule then reminding
  667. // schedule should be finished
  668. PosParameter paramB = new PosParameter();
  669. paramB.setWhereClauseParameter(0, "3" + SlabNo.substring(1, 10));
  670. PosRowSet LastSlabVo = getDao("mesdao").find(
  671. "NIG020610_SPEC_LAST_SLAB.select", paramB);
  672. if (LastSlabVo.hasNext()) {
  673. PosRow LastSlabROW = LastSlabVo.next();
  674. String SLAB_EDIT_NO = (String) LastSlabROW
  675. .getAttribute("SLAB_EDIT_NO");
  676. if (SlabNo.substring(10, 13).compareTo(SLAB_EDIT_NO) < 0) {
  677. PosParameter paramC = new PosParameter();
  678. paramC.setWhereClauseParameter(0, SlabNo);
  679. paramC.setWhereClauseParameter(1, SlabNo);
  680. PosRowSet remSlabVo = getDao("mesdao").find(
  681. "NIG020610_REM_SLAB.select", paramC);
  682. while (remSlabVo.hasNext()) {
  683. PosRow remSlabROW = remSlabVo.next();
  684. String RemSlabNo = (String) remSlabROW
  685. .getAttribute("SLAB_NO");
  686. String RemPlnSlabNo = (String) remSlabROW
  687. .getAttribute("PLAN_SLAB_NO");
  688. String RemDsnSlabNo = (String) remSlabROW
  689. .getAttribute("DSN_SLAB_NO");
  690. String RemMillFl = (String) remSlabROW
  691. .getAttribute("MILL_FL");
  692. if (RemMillFl != null && RemMillFl.equals("Y")) {
  693. SendProg_NIF024060(RemSlabNo, "M");
  694. }
  695. PosParameter param13 = new PosParameter();
  696. param13.setValueParamter(0, "5");
  697. param13.setValueParamter(1, "3");
  698. param13.setValueParamter(2, RemSlabNo);
  699. this.getDao("mesdao").update("NIG020610_SLAB_END.update",
  700. param13);
  701. param13 = new PosParameter();
  702. param13.setValueParamter(0, RemSlabNo);
  703. this.getDao("mesdao").update("NIG020610_SLAB_END_D.update",
  704. param13);
  705. PosParameter paramD = new PosParameter();
  706. paramD.setWhereClauseParameter(0, RemPlnSlabNo);
  707. PosRowSet remSpecVo = getDao("mesdao").find(
  708. "NIG020610_SLAB_SPEC.select", paramD);
  709. while (remSpecVo.hasNext()) {
  710. PosRow remSpecROW = remSpecVo.next();
  711. Number nSlabEdtSeq = (Number) remSpecROW
  712. .getAttribute("SLAB_EDT_SEQ");
  713. String SlabManaNo = (String) remSpecROW
  714. .getAttribute("SLAB_MANA_NO");
  715. PosParameter paramE = new PosParameter();
  716. paramE.setValueParamter(0, "C");
  717. paramE.setValueParamter(1, SlabManaNo);
  718. this.getDao("mesdao").update(
  719. "NIG020610_SPEC_SLAB.update", paramE);
  720. PosParameter paramF = new PosParameter();
  721. paramF.setValueParamter(0, "C");
  722. paramF.setValueParamter(1, nSlabEdtSeq);
  723. this.getDao("mesdao").update(
  724. "NIG020610_SPEC_SLAB_D.update", paramF);
  725. }
  726. if (SlabRt.equals("P") || SlabRt.equals("Z")) {
  727. PosParameter paramV = new PosParameter();
  728. paramV.setWhereClauseParameter(0, "01");
  729. paramV.setWhereClauseParameter(1, RemDsnSlabNo);
  730. this.getDao("mesdao").update(
  731. "NIG020610_TBD01_SLABDN.update", paramV);
  732. }
  733. }
  734. }
  735. }
  736. }
  737. public String DiffStlGrd(String Slabno, String McNo, String StlGrd) {
  738. String Get_StlGrd = null;
  739. PosParameter param3 = new PosParameter();
  740. param3.setWhereClauseParameter(0, Slabno.substring(0, 10));
  741. param3.setWhereClauseParameter(1, McNo);
  742. param3.setWhereClauseParameter(2, Slabno.substring(0, 10));
  743. PosRowSet DiffStlGrdVO = getDao("mesdao").find(
  744. "NIG020610_DIFF_STL_GRD.select", param3);
  745. if (DiffStlGrdVO.hasNext()) {
  746. PosRow DiffStlGrdROW = DiffStlGrdVO.next();
  747. Get_StlGrd = (String) DiffStlGrdROW.getAttribute("STL_GRD");
  748. if (StlGrd != null && Get_StlGrd != null) {
  749. if (!StlGrd.equals(Get_StlGrd)) {
  750. return Get_StlGrd;
  751. }
  752. }
  753. return null;
  754. }
  755. return null;
  756. }
  757. public String DecSlabWay(String Slabno, String hcrcd, String slabrt,
  758. String sf) {
  759. String way = null;
  760. if (hcrcd != null && hcrcd.equals("C")) {
  761. if ((sf != null && sf.equals("Y"))
  762. || (slabrt != null && slabrt.equals("P"))) {
  763. way = "1";
  764. } else {
  765. way = "2";
  766. }
  767. } else {
  768. way = "3";
  769. }
  770. return way;
  771. }
  772. // SLAB SIZE DECISION ( RESULT SLAB WGT,ORDER WGT COMPARE)
  773. // TBG02_SLAB_COMM--> SLAB_WGT
  774. // TBG02_SLAB_COMM_D --> ORD_NO,ORD_SEQ
  775. // TBA01_ORD_LINE --> PROD_WGT_MIN,PROD_WGT_MAX
  776. public String SlabSizeDec(String SlabNo, String PlanSlabNo, Number SlabWgt) {
  777. logger.logInfo("XinSaveSlabComm runActivity SlabSizeDec:");
  778. BigDecimal SLAB_WGT = new BigDecimal(SlabWgt.doubleValue());
  779. PosParameter param1 = new PosParameter();
  780. param1.setWhereClauseParameter(0, SlabNo);
  781. PosRowSet CommDVO = getDao("mesdao").find(
  782. "NIG020610_SLAB_COMM_D.select", param1);
  783. if (CommDVO.hasNext()) {
  784. PosRow CommDROW = CommDVO.next();
  785. BigDecimal PROD_WGT_MIN = (BigDecimal) CommDROW
  786. .getAttribute("PROD_WGT_MIN");
  787. BigDecimal PROD_WGT_MAX = (BigDecimal) CommDROW
  788. .getAttribute("PROD_WGT_MAX");
  789. logger.logInfo("XinSaveSlabComm runActivity PROD_WGT_MIN:"
  790. + PROD_WGT_MIN);
  791. if ((PROD_WGT_MIN != null && !PROD_WGT_MIN.equals(""))
  792. && (PROD_WGT_MAX != null && !PROD_WGT_MAX.equals(""))) {
  793. if (SLAB_WGT.compareTo(PROD_WGT_MIN) < 0
  794. || PROD_WGT_MAX.compareTo(SLAB_WGT) < 0) {
  795. return "N";
  796. }
  797. }
  798. }
  799. return "Y";
  800. }
  801. public PosContext SendProg_NIE012070(String MatNo, String sOrdNo,
  802. String sOrdSeq, String sBefOrdNo, String sBefOrdSeq,
  803. String sProgCd, String BefProcCd, String sKind, Number nwgt) {
  804. PosContext context = new PosContext();
  805. PosMessage message = new PosMESMessageImpl();
  806. String TcId = "NIE012070";
  807. message.setTCID(TcId);
  808. message.setObject("MSG_ID", TcId);
  809. message.setObject("BEF_ORD_NO", sBefOrdNo);
  810. message.setObject("BEF_ORD_SEQ", sBefOrdSeq);
  811. message.setObject("ORD_NO", sOrdNo);
  812. message.setObject("ORD_SEQ", sOrdSeq);
  813. message.setObject("BEF_PROG_CD", BefProcCd);
  814. message.setObject("PROG_CD", sProgCd);
  815. message.setObject("MAT_TYPE", sKind);
  816. message.setObject("MAT_NO", MatNo);
  817. message.setObject("WGT", nwgt);
  818. message.setObject("PGMID", "XinSaveSlabComm");
  819. message.setObject("REG_ID", "CCM L2");
  820. message.setTCID(TcId);
  821. context.setMessage(message);
  822. // this.processComponent(PosConstants.CREATE_MESSAGE, context);
  823. // String transactionCode = context.getMessage().getTC();
  824. String SERVICE_POSTFIX = "-service";
  825. context
  826. .put(PosBizControlConstants.SERVICE_NAME, TcId
  827. + SERVICE_POSTFIX);
  828. // context.setMessage(message);
  829. PosBizControlIF controller = PosBizProvider.getController();
  830. controller.doSubController(context, false);
  831. return null;
  832. }
  833. public PosContext SendProg_NIE012080() {
  834. PosContext context = new PosContext();
  835. PosMessage message = new PosMESMessageImpl();
  836. String TcId = "NIE012080";
  837. message.setTCID(TcId);
  838. message.setObject("MSG_ID", TcId);
  839. message.setObject("AA", null);
  840. context.setMessage(message);
  841. this.processComponent(PosConstants.CREATE_MESSAGE, context);
  842. String transactionCode = context.getMessage().getTC();
  843. message.setTCID(TcId);
  844. String serviceName = "NIE012080";
  845. String SERVICE_POSTFIX = "-service";
  846. context.put(PosBizControlConstants.SERVICE_NAME, serviceName
  847. + SERVICE_POSTFIX);
  848. context.setMessage(message);
  849. PosBizControlIF controller = PosBizProvider.getController();
  850. controller.doSubController(context, false);
  851. return null;
  852. }
  853. public PosContext SendProg_NIG020640(String SlabNo, String Stlgrd,
  854. String SlabLoc) {
  855. PosContext context = new PosContext();
  856. PosMessage message = new PosMESMessageImpl();
  857. String TcId = "NIG020640";
  858. // message.setTCID(TcId);
  859. message.setObject("MSG_ID", TcId);
  860. message.setObject("SLAB_NO", SlabNo);
  861. message.setObject("STL_GRD", Stlgrd);
  862. message.setObject("SLAB_LOC", SlabLoc);
  863. message.setTCID(TcId);
  864. context.setMessage(message);
  865. // this.processComponent(PosConstants.CREATE_MESSAGE, context);
  866. // String transactionCode = context.getMessage().getTC();
  867. String serviceName = "NIG020640";
  868. String SERVICE_POSTFIX = "-service";
  869. context.put(PosBizControlConstants.SERVICE_NAME, serviceName
  870. + SERVICE_POSTFIX);
  871. // context.setMessage(message);
  872. PosBizControlIF controller = PosBizProvider.getController();
  873. controller.doSubController(context, false);
  874. return null;
  875. }
  876. // call mill scheduling reject service class
  877. public void SendProg_NIF024060(String SlabNo, String RejType) {
  878. logger.logInfo("PosSaveMissionNo SendProg_NIF024060 ");
  879. PosContext context = new PosContext();
  880. PosMessage message = new PosMESMessageImpl();
  881. String TcId = "NIF024060";
  882. message.setTCID(TcId);
  883. message.setObject("MSG_ID", TcId);
  884. message.setObject("TYPE", RejType);
  885. message.setObject("FROM", SlabNo);
  886. message.setObject("TO", SlabNo);
  887. message.setObject("REG_ID", "NIG020610");
  888. context.setMessage(message);
  889. this.processComponent(PosConstants.CREATE_MESSAGE, context);
  890. String transactionCode = context.getMessage().getTC();
  891. message.setTCID(TcId);
  892. String serviceName = "NIF024060";
  893. String SERVICE_POSTFIX = "-service";
  894. context.put(PosBizControlConstants.SERVICE_NAME, serviceName
  895. + SERVICE_POSTFIX);
  896. context.setMessage(message);
  897. PosBizControlIF controller = PosBizProvider.getController();
  898. controller.doSubController(context, false);
  899. }
  900. // call mill scheduling reject service class
  901. public void searchBeforeEnd(String SlabNo, String CCM_NO, String PlanSlabNo) {
  902. PosParameter param1 = new PosParameter();
  903. param1.setWhereClauseParameter(0, SlabNo);
  904. param1.setWhereClauseParameter(1, CCM_NO);
  905. PosRowSet LastCutVO = getDao("mesdao").find(
  906. "NIG020610_LAST_CUT.select", param1);
  907. if (LastCutVO.hasNext()) {
  908. PosRow LastCutROW = LastCutVO.next();
  909. String CutCnt = (String) LastCutROW.getAttribute("LAST_SLAB_YN");
  910. String SLAB_NO = (String) LastCutROW.getAttribute("SLAB_NO");
  911. String SLAB_RT = (String) LastCutROW.getAttribute("SLAB_RT");
  912. String PLAN_CHARGE_NO = (String) LastCutROW
  913. .getAttribute("PLAN_CHARGE_NO");
  914. if (CutCnt.equals("0")) {
  915. LastSlabCut(SLAB_NO, PLAN_CHARGE_NO + "010", "", SLAB_RT, "");
  916. PosParameter paramz = new PosParameter();
  917. paramz.setValueParamter(0, "E");
  918. paramz.setValueParamter(1, SLAB_NO);
  919. this.getDao("mesdao").update("NIG020610_SLAB_COMM_LAST.update",
  920. paramz);
  921. }
  922. }
  923. }
  924. // RHF Level1,Level2 Slab Take In Sending
  925. public void updateRHFL1(String SlabNo, String HcrFl) {
  926. HcrFl = "H";
  927. String DestPos = null;
  928. if (HcrFl != null && HcrFl.equals("H")) {
  929. DestPos = "A7";
  930. } else {
  931. DestPos = "A1";
  932. }
  933. PosParameter paramz = new PosParameter();
  934. paramz.setValueParamter(0, "FML010");
  935. paramz.setValueParamter(1, SlabNo);
  936. paramz.setValueParamter(2, "A1");
  937. paramz.setValueParamter(3, HcrFl);
  938. paramz.setValueParamter(4, DestPos);
  939. this.getDao("mesdao").update("UIG040042_L1_TAKEIN.insert", paramz);
  940. }
  941. public String SlabSizeDec(BigDecimal slabThk, BigDecimal slabWth,
  942. BigDecimal slabLen, String SlabNo, String PlanSlabNo,
  943. BigDecimal SlabWgt) {
  944. logger.logInfo("XinSaveSlabComm SlabWgt:" + SlabWgt);
  945. BigDecimal SlabThk = slabThk;
  946. BigDecimal SlabWth = slabWth;
  947. BigDecimal SlabLen = slabLen;
  948. BigDecimal ordThk = new BigDecimal(0);
  949. BigDecimal ordWth = new BigDecimal(0);
  950. BigDecimal ordLen = new BigDecimal(0);
  951. BigDecimal ordWgt = new BigDecimal(0);
  952. BigDecimal coilOutDia = new BigDecimal(0);
  953. BigDecimal coilInDia = new BigDecimal(0);
  954. PosParameter param1 = new PosParameter();
  955. param1.setWhereClauseParameter(0, SlabNo);
  956. PosRowSet CommDVO = getDao("mesdao").find(
  957. "NIG020610_SLAB_COMM_D.select", param1);
  958. PosRowSet CommDVO2 = getDao("mesdao").find(
  959. "UIG020060_SLAB_COMMD_ORD.select", param1);
  960. if (CommDVO2.hasNext()) {
  961. PosRow row = CommDVO2.next();
  962. ordThk = (BigDecimal) row.getAttribute("ORD_THK");
  963. ordWth = (BigDecimal) row.getAttribute("ORD_WTH");
  964. coilInDia = (BigDecimal) row.getAttribute("COIL_INDIA");
  965. }
  966. BigDecimal total = ordWth.add(new BigDecimal(100));
  967. if (SlabWth.compareTo(ordWth) < 0 || total.compareTo(SlabWth) < 0) {
  968. return "N";
  969. }
  970. param1 = new PosParameter();
  971. PosRowSet rateVo = getDao("mesdao").find("UIG020060_proc_rate.select",
  972. param1);
  973. BigDecimal procRate = new BigDecimal(1);
  974. if (rateVo.hasNext()) {
  975. PosRow posrow = rateVo.next();
  976. procRate = (BigDecimal) posrow.getAttribute("PROC_RATE");
  977. }
  978. if (CommDVO.hasNext()) {
  979. PosRow CommDROW = CommDVO.next();
  980. BigDecimal PROD_WGT_MIN = (BigDecimal) CommDROW
  981. .getAttribute("PROD_WGT_MIN");
  982. BigDecimal PROD_WGT_MAX = (BigDecimal) CommDROW
  983. .getAttribute("PROD_WGT_MAX");
  984. logger.logInfo("XinSaveSlabComm PROD_WGT_MIN:" + PROD_WGT_MIN);
  985. logger.logInfo(PROD_WGT_MIN);
  986. logger.logInfo(PROD_WGT_MAX);
  987. ordWgt = SlabWgt.multiply(procRate);
  988. ordWgt = ordWgt.divide(new BigDecimal(100));
  989. logger.logInfo("XinSaveSlabComm ordWgt:" + ordWgt);
  990. if (PROD_WGT_MIN == null)
  991. PROD_WGT_MIN = new BigDecimal(0);
  992. if (PROD_WGT_MAX == null)
  993. PROD_WGT_MAX = new BigDecimal(300000);
  994. // 如果板坯重量不在订单重量范围内
  995. if (ordWgt.compareTo(PROD_WGT_MIN) < 0
  996. || PROD_WGT_MAX.compareTo(ordWgt) < 0) {
  997. // 取消订单
  998. return "N";
  999. }
  1000. }
  1001. logger.logInfo("ordWgt=" + ordWgt);
  1002. logger.logInfo("ordThk=" + ordThk);
  1003. logger.logInfo("SlabWth=" + SlabWth);
  1004. ordLen = ordWgt.multiply(new BigDecimal(1000000));
  1005. ordLen = ordLen.divide(ordThk, 3, BigDecimal.ROUND_HALF_UP);
  1006. ordLen = ordLen.divide(ordWth, 3, BigDecimal.ROUND_HALF_UP);
  1007. ordLen = ordLen.divide(new BigDecimal(7.8), 0,BigDecimal.ROUND_HALF_UP);
  1008. coilOutDia = new BigDecimal(Math.sqrt(ordWgt.multiply(
  1009. new BigDecimal(1000000).multiply(new BigDecimal(4)).divide(
  1010. new BigDecimal(7.8 * 3.14 * 0.98), 3,
  1011. BigDecimal.ROUND_HALF_UP).divide(ordWth, 0,
  1012. BigDecimal.ROUND_HALF_UP)).add(
  1013. coilInDia.multiply(coilInDia)).doubleValue()));
  1014. param1 = new PosParameter();
  1015. param1.setWhereClauseParameter(0, slabThk);
  1016. param1.setWhereClauseParameter(1, slabWth);
  1017. param1.setWhereClauseParameter(2, slabLen);
  1018. param1.setWhereClauseParameter(3, ordLen);
  1019. param1.setWhereClauseParameter(4, ordWgt);
  1020. param1.setWhereClauseParameter(5, coilOutDia);
  1021. param1.setWhereClauseParameter(6, SlabNo);
  1022. int rowset = getDao("mesdao").update("UIG020060_slab_comm_d.update",param1);
  1023. return "Y";
  1024. }
  1025. }