424da239124768ff5165ba580bb89f65e7f8e772.svn-base 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  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 MILLL2Resend 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. String V_ROLL_MANA_ST = "" ;
  18. String V_ROLL_MANA_EN = "" ;
  19. //SLAB_NO FROM/TO/TARGET
  20. String[] P_ST = (String[])context.get("FROM");
  21. String[] P_EN = (String[])context.get("TO");
  22. String[] P_TYPE = (String[])context.get("TYPE");
  23. // try {
  24. //START ROLL_MANA_NO, SLAB_EDT_SEQ, ROLL_SLAB_SEQ CHECK
  25. if (P_TYPE[0].equals("S")) {
  26. PosParameter paramA = new PosParameter();
  27. paramA.setWhereClauseParameter(0, P_ST[0]);
  28. paramA.setWhereClauseParameter(1, P_EN[0]);
  29. PosRowSet RollManaNoSTVO = getDao("mesdao").find("UIF024040_RollManaNo.select",paramA);
  30. RollManaNoSTVO.reset();
  31. if (RollManaNoSTVO.hasNext()) {
  32. PosRow RollManaNoSTRow = RollManaNoSTVO.next();
  33. V_ROLL_MANA_ST = (String)RollManaNoSTRow.getAttribute("ROLL_MANA_ST");
  34. V_ROLL_MANA_EN = (String)RollManaNoSTRow.getAttribute("ROLL_MANA_EN");
  35. V_SLAB_EDT_SEQ_ST = Long.parseLong((RollManaNoSTRow.getAttribute("SLAB_EDT_SEQ_ST")==null? "0":RollManaNoSTRow.getAttribute("SLAB_EDT_SEQ_ST")).toString());
  36. V_SLAB_EDT_SEQ_EN = Long.parseLong((RollManaNoSTRow.getAttribute("SLAB_EDT_SEQ_EN")==null? "0":RollManaNoSTRow.getAttribute("SLAB_EDT_SEQ_EN")).toString());
  37. } else {
  38. V_ROLL_MANA_ST = "";
  39. V_ROLL_MANA_EN = "";
  40. V_SLAB_EDT_SEQ_ST = 0;
  41. V_SLAB_EDT_SEQ_EN = 0;
  42. }
  43. }
  44. if (P_ST[0].equals("") || P_EN[0].equals("")){
  45. //MESSAGE ERROR --> PROGRAM EXIT
  46. throw new PosException("MILLSlabSeqChange..ROLL_MANA ST/EN/TG IS NULL..");
  47. }
  48. //START ROLL_MANA_NO, SLAB_EDT_SEQ, ROLL_SLAB_SEQ CHECK
  49. PosParameter paramD = new PosParameter();
  50. paramD.setWhereClauseParameter(0, P_ST[0]);
  51. paramD.setWhereClauseParameter(1, P_EN[0]);
  52. PosRowSet RollSlabSeqFindVO = getDao("mesdao").find("UIF024040_RollSlabSeqFind.select",paramD);
  53. RollSlabSeqFindVO.reset();
  54. if (RollSlabSeqFindVO.hasNext()) {
  55. PosRow RollSlabSeqFindRow = RollSlabSeqFindVO.next();
  56. V_SEQ_ST = Long.parseLong((RollSlabSeqFindRow.getAttribute("ROLL_SLAB_SEQ_ST")==null? "0":RollSlabSeqFindRow.getAttribute("ROLL_SLAB_SEQ_ST")).toString());
  57. V_SEQ_EN = Long.parseLong((RollSlabSeqFindRow.getAttribute("ROLL_SLAB_SEQ_EN")==null? "0":RollSlabSeqFindRow.getAttribute("ROLL_SLAB_SEQ_EN")).toString());
  58. } else {
  59. V_SEQ_ST = 0;
  60. V_SEQ_EN = 0;
  61. }
  62. //ROLL_SLAB_SEQ CHECK 1 CASE
  63. if (V_SEQ_ST > V_SEQ_EN || (V_SEQ_ST < V_SEQ_TG && V_SEQ_EN > V_SEQ_TG)) {
  64. //MESSAGE ERROR --> PROGRAM EXIT
  65. logger.logError("MILLSlabSeqChange..ROLL_SLAB_SEQ EQ_ST > SEQ_EN OR EQ_ST < V_SEQ_TG < SEQ_EN..");
  66. context.put("errorMsg", "MILLSlabSeqChange..ROLL_SLAB_SEQ EQ_ST > SEQ_EN OR EQ_ST < V_SEQ_TG < SEQ_EN..");
  67. return PosBizControlConstants.FAILURE;
  68. //throw new PosException("MILLSlabSeqChange..ROLL_SLAB_SEQ EQ_ST > SEQ_EN OR EQ_ST < V_SEQ_TG < SEQ_EN..");
  69. }
  70. if (P_TYPE[0].equals("R")) {
  71. l2_mill_resend(P_TYPE[0],P_ST[0],P_EN[0],null);
  72. }else if(P_TYPE[0].equals("S")){
  73. l2_mill_resend(P_TYPE[0],String.valueOf(V_SEQ_ST),String.valueOf(V_SEQ_EN),V_ROLL_MANA_ST);
  74. }else {
  75. logger.logError("l2_rht_resend()...p_type is null... 选择对象类型...");
  76. context.put("errorMsg", "l2_rht_resend()...p_type is null... 选择对象类型...");
  77. return PosBizControlConstants.FAILURE;
  78. //throw new PosException("l2_rht_resend()...p_type is null... 选择对象类型...");
  79. }
  80. return PosBizControlConstants.SUCCESS;
  81. }
  82. public void l2_mill_resend(String p_type,String p_st,String p_end,String p_roll_mana_no) {
  83. PosParameter param_resend = new PosParameter();
  84. if (p_type.equals("R")) {
  85. param_resend.setWhereClauseParameter(0, p_st);
  86. param_resend.setWhereClauseParameter(1, p_end);
  87. this.getDao("mesdao").update("UIF024010.mill_l2_resend_by_R_update",param_resend);
  88. }else if(p_type.equals("S")){
  89. param_resend.setWhereClauseParameter(0, p_st);
  90. param_resend.setWhereClauseParameter(1, p_end);
  91. param_resend.setWhereClauseParameter(2, p_roll_mana_no);
  92. this.getDao("mesdao").update("UIF024010.mill_l2_resend_by_S_update",param_resend);
  93. }else {
  94. throw new PosException("l2_mill_resend()...p_type is null... 选择对象类型...");
  95. }
  96. }
  97. }