cc69eb3a673aa73d4d7618a2a0909887e85c9fb0.svn-base 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. package xin.glue.nui.H.H02;
  2. import java.math.BigDecimal;
  3. import com.posdata.glue.biz.activity.PosActivity;
  4. import com.posdata.glue.biz.constants.PosBizControlConstants;
  5. import com.posdata.glue.biz.control.PosBizControlIF;
  6. import com.posdata.glue.biz.control.PosBizProvider;
  7. import com.posdata.glue.component.PosConstants;
  8. import com.posdata.glue.context.PosContext;
  9. import com.posdata.glue.dao.vo.PosParameter;
  10. import com.posdata.glue.dao.vo.PosRow;
  11. import com.posdata.glue.dao.vo.PosRowSet;
  12. import com.posdata.glue.msg.PosMESMessageImpl;
  13. import com.posdata.glue.msg.PosMessage;
  14. import com.posdata.glue.util.log.PosLog;
  15. import com.posdata.glue.util.log.PosLogFactory;
  16. public class XinSaveSlabRoller extends PosActivity
  17. {
  18. private final PosLog log = PosLogFactory.getLogger(getClass());
  19. public String runActivity(PosContext context)
  20. {
  21. PosMessage message = context.getMessage();
  22. String[] A_SLAB = new String[7];
  23. String[] C_SLAB = new String[6];
  24. A_SLAB[0] = (String)message.get("A1_SLAB_NO");
  25. A_SLAB[1] = (String)message.get("A2_SLAB_NO");
  26. A_SLAB[2] = (String)message.get("A3_SLAB_NO");
  27. A_SLAB[3] = (String)message.get("A4_SLAB_NO");
  28. A_SLAB[4] = (String)message.get("A5_SLAB_NO");
  29. A_SLAB[5] = (String)message.get("A6_SLAB_NO");
  30. A_SLAB[6] = (String)message.get("A7_SLAB_NO");
  31. C_SLAB[0] = (String)message.get("C7_SLAB_NO");
  32. C_SLAB[1] = (String)message.get("C8_SLAB_NO");
  33. C_SLAB[2] = (String)message.get("C9_SLAB_NO");
  34. C_SLAB[3] = (String)message.get("C10_SLAB_NO");
  35. C_SLAB[4] = (String)message.get("C11_SLAB_NO");
  36. C_SLAB[5] = (String)message.get("C12_SLAB_NO");
  37. String MSG_DTIME = (String)message.get("MSG_DTIME");
  38. String YardAddr = null;
  39. int i = 0;
  40. for ( i =0 ; i < 7 ; i++ ) {
  41. PosParameter param2 = new PosParameter();
  42. param2.setWhereClauseParameter(0, A_SLAB[i]);
  43. PosRowSet YardExistVo = getDao("mesdao").find("NIH020080_SLAB_EXIST.select", param2);
  44. if (YardExistVo.hasNext()) {
  45. PosRow YardExistROW = YardExistVo.next();
  46. String DupAddr = (String)YardExistROW.getAttribute("YARD_ADDR");
  47. PosParameter param3 = new PosParameter();
  48. param3.setWhereClauseParameter(0, DupAddr);
  49. this.getDao("mesdao").update("NIH020080_SLAB_EXIST.update", param3);
  50. }
  51. PosParameter param = new PosParameter();
  52. YardAddr = "A"+String.valueOf(i+1);
  53. param.setWhereClauseParameter(0, A_SLAB[i]);
  54. param.setWhereClauseParameter(1, MSG_DTIME);
  55. param.setWhereClauseParameter(2, "RHF L2");
  56. param.setWhereClauseParameter(3, YardAddr);
  57. this.getDao("mesdao").update("NIH020080_01.update", param);
  58. }
  59. YardAddr = null;
  60. for ( i =0 ; i < 6 ; i++ ) {
  61. PosParameter param2 = new PosParameter();
  62. param2.setWhereClauseParameter(0, C_SLAB[i]);
  63. PosRowSet YardExistVo = getDao("mesdao").find("NIH020080_SLAB_EXIST.select", param2);
  64. if (YardExistVo.hasNext()) {
  65. PosRow YardExistROW = YardExistVo.next();
  66. String DupAddr = (String)YardExistROW.getAttribute("YARD_ADDR");
  67. PosParameter param3 = new PosParameter();
  68. param3.setWhereClauseParameter(0, DupAddr);
  69. this.getDao("mesdao").update("NIH020080_SLAB_EXIST.update", param3);
  70. }
  71. PosParameter param1 = new PosParameter();
  72. YardAddr = "C"+String.valueOf(i+7);
  73. param1.setWhereClauseParameter(0, C_SLAB[i]);
  74. param1.setWhereClauseParameter(1, MSG_DTIME);
  75. param1.setWhereClauseParameter(2, "RHF L2");
  76. param1.setWhereClauseParameter(3, YardAddr);
  77. this.getDao("mesdao").update("NIH020080_01.update", param1);
  78. }
  79. /*
  80. if ( A_SLAB[6] != null && !A_SLAB[6].equals("")) {
  81. PosParameter param5 = new PosParameter();
  82. param5.setWhereClauseParameter(0, A_SLAB[6]);
  83. PosRowSet specMillVo = getDao("mesdao").find("NIH020080_SPEC_MILL.select", param5);
  84. String CoilNo = null;
  85. if (specMillVo.hasNext() ) {
  86. PosRow specMillROW = specMillVo.next();
  87. CoilNo = (String)specMillROW.getAttribute("COIL_NO");
  88. }
  89. if (CoilNo != null) {
  90. PosParameter paramy = new PosParameter();
  91. paramy.setValueParamter(0, "HMFU30");
  92. paramy.setValueParamter(1, "A7" );
  93. paramy.setValueParamter(2, A_SLAB[6] );
  94. paramy.setValueParamter(3, CoilNo );
  95. this.getDao("mesdao").update("UIG040042_L2_TAKEIN.insert",paramy);
  96. }
  97. }
  98. */
  99. return PosBizControlConstants.SUCCESS;
  100. }
  101. }