8ff05212f776db1b817104df6a3d7e650c9c1a38.svn-base 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177
  1. package xin.glue.ui.F.F02;
  2. import xin.glue.user.common.GlobalConstants;
  3. import com.posdata.glue.PosException;
  4. import com.posdata.glue.biz.activity.PosActivity;
  5. import com.posdata.glue.biz.constants.PosBizControlConstants;
  6. import com.posdata.glue.context.PosContext;
  7. import com.posdata.glue.dao.vo.PosParameter;
  8. import com.posdata.glue.dao.vo.PosRow;
  9. import com.posdata.glue.dao.vo.PosRowSet;
  10. public class RHTL2Resend extends PosActivity implements GlobalConstants {
  11. public String runActivity(PosContext context) {
  12. long V_SLAB_EDT_SEQ_ST = 0 ;
  13. long V_SLAB_EDT_SEQ_EN = 0 ;
  14. long V_SEQ_ST = 0 ;
  15. long V_SEQ_EN = 0 ;
  16. long V_SEQ_TG = 0 ;
  17. long V_MOVE_HCR = 0 ;
  18. long V_STATUS_CNT = 0 ;
  19. long V_COIL_STAT_CNT = 0;
  20. String V_ROLL_MANA_ST = "" ;
  21. String V_ROLL_MANA_EN = "" ;
  22. //SLAB_NO FROM/TO/TARGET
  23. String[] P_ST = (String[])context.get("FROM");
  24. String[] P_EN = (String[])context.get("TO");
  25. String[] P_TYPE = (String[])context.get("TYPE");
  26. // try {
  27. //START ROLL_MANA_NO, SLAB_EDT_SEQ, ROLL_SLAB_SEQ CHECK
  28. if (P_TYPE[0].equals("S")) {
  29. PosParameter paramA = new PosParameter();
  30. paramA.setWhereClauseParameter(0, P_ST[0]);
  31. paramA.setWhereClauseParameter(1, P_EN[0]);
  32. PosRowSet RollManaNoSTVO = getDao("mesdao").find("UIF024040_RollManaNo.select",paramA);
  33. RollManaNoSTVO.reset();
  34. if (RollManaNoSTVO.hasNext()) {
  35. PosRow RollManaNoSTRow = RollManaNoSTVO.next();
  36. V_ROLL_MANA_ST = (String)RollManaNoSTRow.getAttribute("ROLL_MANA_ST");
  37. V_ROLL_MANA_EN = (String)RollManaNoSTRow.getAttribute("ROLL_MANA_EN");
  38. V_SLAB_EDT_SEQ_ST = Long.parseLong((RollManaNoSTRow.getAttribute("SLAB_EDT_SEQ_ST")==null? "0":RollManaNoSTRow.getAttribute("SLAB_EDT_SEQ_ST")).toString());
  39. V_SLAB_EDT_SEQ_EN = Long.parseLong((RollManaNoSTRow.getAttribute("SLAB_EDT_SEQ_EN")==null? "0":RollManaNoSTRow.getAttribute("SLAB_EDT_SEQ_EN")).toString());
  40. } else {
  41. V_ROLL_MANA_ST = "";
  42. V_ROLL_MANA_EN = "";
  43. V_SLAB_EDT_SEQ_ST = 0;
  44. V_SLAB_EDT_SEQ_EN = 0;
  45. }
  46. }
  47. if (P_ST[0].equals("") || P_EN[0].equals("")){
  48. //MESSAGE ERROR --> PROGRAM EXIT
  49. logger.logError("MILLSlabSeqChange..ROLL_MANA ST/EN/TG IS NULL..");
  50. context.put("errorMsg", "MILLSlabSeqChange..ROLL_MANA ST/EN/TG IS NULL..");
  51. return PosBizControlConstants.FAILURE;
  52. //throw new PosException("MILLSlabSeqChange..ROLL_MANA ST/EN/TG IS NULL..");
  53. }
  54. //START ROLL_MANA_NO, SLAB_EDT_SEQ, ROLL_SLAB_SEQ CHECK
  55. PosParameter paramD = new PosParameter();
  56. paramD.setWhereClauseParameter(0, P_ST[0]);
  57. paramD.setWhereClauseParameter(1, P_EN[0]);
  58. PosRowSet RollSlabSeqFindVO = getDao("mesdao").find("UIF024040_RollSlabSeqFind.select",paramD);
  59. RollSlabSeqFindVO.reset();
  60. if (RollSlabSeqFindVO.hasNext()) {
  61. PosRow RollSlabSeqFindRow = RollSlabSeqFindVO.next();
  62. V_SEQ_ST = Long.parseLong((RollSlabSeqFindRow.getAttribute("ROLL_SLAB_SEQ_ST")==null? "0":RollSlabSeqFindRow.getAttribute("ROLL_SLAB_SEQ_ST")).toString());
  63. V_SEQ_EN = Long.parseLong((RollSlabSeqFindRow.getAttribute("ROLL_SLAB_SEQ_EN")==null? "0":RollSlabSeqFindRow.getAttribute("ROLL_SLAB_SEQ_EN")).toString());
  64. } else {
  65. V_SEQ_ST = 0;
  66. V_SEQ_EN = 0;
  67. }
  68. //ROLL_SLAB_SEQ CHECK 1 CASE
  69. if (V_SEQ_ST > V_SEQ_EN || (V_SEQ_ST < V_SEQ_TG && V_SEQ_EN > V_SEQ_TG)) {
  70. //MESSAGE ERROR --> PROGRAM EXIT
  71. logger.logError("MILLSlabSeqChange..ROLL_SLAB_SEQ EQ_ST > SEQ_EN OR EQ_ST < V_SEQ_TG < SEQ_EN..");
  72. context.put("errorMsg", "MILLSlabSeqChange..ROLL_SLAB_SEQ EQ_ST > SEQ_EN OR EQ_ST < V_SEQ_TG < SEQ_EN..");
  73. return PosBizControlConstants.FAILURE;
  74. //throw new PosException("MILLSlabSeqChange..ROLL_SLAB_SEQ EQ_ST > SEQ_EN OR EQ_ST < V_SEQ_TG < SEQ_EN..");
  75. }
  76. //STATUS_CD = 'B', HCR SLAB CHECK (MOVE)
  77. PosParameter paramF = new PosParameter();
  78. paramF.setWhereClauseParameter(0, V_ROLL_MANA_ST);
  79. paramF.setWhereClauseParameter(1, String.valueOf(V_SEQ_ST));
  80. paramF.setWhereClauseParameter(2, String.valueOf(V_SEQ_EN));
  81. PosRowSet MoveChkFindVO = getDao("mesdao").find("NIF024040_MoveChkFind.select",paramF);
  82. MoveChkFindVO.reset();
  83. if (MoveChkFindVO.hasNext()) {
  84. PosRow MoveChkFindRow = MoveChkFindVO.next();
  85. V_MOVE_HCR = Long.parseLong((MoveChkFindRow.getAttribute("HCR_CNT")==null? "0":MoveChkFindRow.getAttribute("HCR_CNT")).toString());
  86. V_STATUS_CNT = Long.parseLong((MoveChkFindRow.getAttribute("STATUS_CNT")==null? "0":MoveChkFindRow.getAttribute("STATUS_CNT")).toString());
  87. V_COIL_STAT_CNT = Long.parseLong((MoveChkFindRow.getAttribute("COIL_STAT_CNT")==null? "0":MoveChkFindRow.getAttribute("COIL_STAT_CNT")).toString());
  88. } else {
  89. V_MOVE_HCR = 0;
  90. V_STATUS_CNT = 0;
  91. }
  92. //STATUS_CD = 'B' RHT START
  93. if (V_STATUS_CNT != 0) {
  94. //MESSAGE ERROR --> PROGRAM EXIT
  95. logger.logError("MILLSlabSeqChange..RHT WORK START..");
  96. context.put("errorMsg", "MILLSlabSeqChange..RHT WORK START..");
  97. return PosBizControlConstants.FAILURE;
  98. //throw new PosException("MILLSlabSeqChange..RHT WORK START..");
  99. }
  100. //COIL_STAT = '0' RHT 已上料
  101. if (V_COIL_STAT_CNT != 0){ //移动对象中含有轧制进行的板坯
  102. //MESSAGE ERROR --> PROGRAM EXIT
  103. //throw new PosException("MILLRollSeqChange..STATUS_CD = 'B'..");
  104. throw new PosException("移动对象已处于上料!");
  105. }
  106. if (P_TYPE[0].equals("R")) {
  107. l2_rht_resend(P_TYPE[0],P_ST[0],P_EN[0],null);
  108. }else if(P_TYPE[0].equals("S")){
  109. l2_rht_resend(P_TYPE[0],String.valueOf(V_SEQ_ST),String.valueOf(V_SEQ_EN),V_ROLL_MANA_ST);
  110. }else {
  111. throw new PosException("l2_rht_resend()...p_type is null... 选择对象类型...");
  112. }
  113. return PosBizControlConstants.SUCCESS;
  114. }
  115. public void l2_rht_resend(String p_type,String p_st,String p_end,String p_roll_mana_no) {
  116. PosParameter param_resend = new PosParameter();
  117. if (p_type.equals("R")) {
  118. param_resend.setWhereClauseParameter(0, p_st);
  119. param_resend.setWhereClauseParameter(1, p_end);
  120. this.getDao("mesdao").update("UIF024010.rht_l2_resend_by_R_update",param_resend);
  121. }else if(p_type.equals("S")){
  122. param_resend.setWhereClauseParameter(0, p_st);
  123. param_resend.setWhereClauseParameter(1, p_end);
  124. param_resend.setWhereClauseParameter(2, p_roll_mana_no);
  125. this.getDao("mesdao").update("UIF024010.rht_l2_resend_by_S_update",param_resend);
  126. }else {
  127. throw new PosException("l2_rht_resend()...p_type is null... 选择对象类型...");
  128. }
  129. }
  130. }