7ef601215b530e58ba53a394f221767eb781a034.svn-base 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  1. package xin.glue.ui.G.G04;
  2. import com.posdata.glue.biz.activity.PosActivity;
  3. import com.posdata.glue.biz.constants.PosBizControlConstants;
  4. import com.posdata.glue.biz.control.PosBizControlIF;
  5. import com.posdata.glue.biz.control.PosBizProvider;
  6. import com.posdata.glue.component.PosConstants;
  7. import com.posdata.glue.context.PosContext;
  8. import com.posdata.glue.dao.vo.PosParameter;
  9. import com.posdata.glue.dao.vo.PosRow;
  10. import com.posdata.glue.dao.vo.PosRowSet;
  11. import com.posdata.glue.msg.PosMESMessageImpl;
  12. import com.posdata.glue.msg.PosMessage;
  13. public class PosComplusMove extends PosActivity{
  14. public String runActivity(PosContext context)
  15. {
  16. String[] rowStatus = (String[]) context.get("rowStatus");
  17. String[] YARD_ADDR = (String[]) context.get("YARD_ADDR");
  18. String[] SLAB_NO = (String[]) context.get("SLAB_NO");
  19. String[] FROM_ADDR = (String[]) context.get("FROM_ADDR");
  20. String[] TO_ADDR = (String[]) context.get("TO_ADDR");
  21. logger.logInfo("PosComplusMove---> rowStatus["+ rowStatus.length+"]" );
  22. for(int i=rowStatus.length - 1;i>=0 ;i--){
  23. PosParameter param1 = new PosParameter();
  24. param1.setWhereClauseParameter(0, TO_ADDR[i] );
  25. PosRowSet CompToVo = getDao("mesdao").find("UIG040060_COMPLUS_TO_ADDR.select", param1);
  26. if(CompToVo.hasNext()) {
  27. PosRow CompToVoROW = CompToVo.next();
  28. String StoreLay = (String)CompToVoROW.getAttribute("STORELAY");
  29. // TO Address SLAB NO Setting
  30. PosParameter param2 = new PosParameter();
  31. param2.setValueParamter(0, SLAB_NO[i]);
  32. param2.setValueParamter(1, "UIG040060");
  33. param2.setValueParamter(2, YARD_ADDR[i]);
  34. param2.setValueParamter(3, StoreLay);
  35. param2.setValueParamter(4, TO_ADDR[i]);
  36. getDao("mesdao").update("UIG040060_COMPLUS_MOVE.update",param2);
  37. // From Address SLAB NO CLEAR
  38. PosParameter param3 = new PosParameter();
  39. param3.setValueParamter(0, YARD_ADDR[i]);
  40. getDao("mesdao").update("UIG040060_COMPLUS_FROM_02.update",param3);
  41. // TBG02_SLAB_COMM_CUR_LOAD_LOC, ENTER_STOCK_DTIME SETTING
  42. String yard_addr = null;
  43. String storelay = null;
  44. param3 = new PosParameter();
  45. String slabYardStr = "SELECT YARD_ADDR ,STORELAY FROM TBG04_SLAB_YARD WHERE SLAB_NO = ?";
  46. param3.setWhereClauseParameter(0,SLAB_NO[i]);
  47. PosRowSet yardAddr = getDao("mesdao").findByQueryStatement(slabYardStr, param3);
  48. if(yardAddr.hasNext()){
  49. PosRow row = yardAddr.next();
  50. yard_addr = (String)row.getAttribute("YARD_ADDR");
  51. storelay = (String)row.getAttribute("STORELAY");
  52. }
  53. PosParameter param4 = new PosParameter();
  54. // Mill Schedule delete request
  55. PosParameter param5 = new PosParameter();
  56. param5.setWhereClauseParameter(0, SLAB_NO[i]);
  57. //PosRowSet SpecSlabVO = getDao("mesdao").find("UIG040042_SPEC_SLAB.select", param5);
  58. PosRowSet SpecSlabVO = getDao("mesdao").find("UIG040042_SPEC_SLAB_MILL_FL.select", param5);
  59. if(yard_addr.substring(0,1).equals("Z")){
  60. param4.setWhereClauseParameter(0, yard_addr+storelay);
  61. param4.setWhereClauseParameter(1, SLAB_NO[i]);
  62. if(SpecSlabVO.hasNext()) {
  63. PosRow SpecSlabROW = SpecSlabVO.next();
  64. String MillFl = (String)SpecSlabROW.getAttribute("MILL_FL");
  65. if(MillFl != null && MillFl.equals("Y")) {
  66. getDao("mesdao").update("UIG040060_LOC_03.update",param4);
  67. }else{
  68. getDao("mesdao").update("UIG040060_LOC_01.update",param4);
  69. }
  70. }
  71. }else if(yard_addr.substring(0,1).equals("L")){
  72. param4.setWhereClauseParameter(0, yard_addr+storelay);
  73. param4.setWhereClauseParameter(1, SLAB_NO[i]);
  74. getDao("mesdao").update("UIG040060_LOC_02.update",param4);
  75. }
  76. /*
  77. if(SpecSlabVO.hasNext()) {
  78. PosRow SpecSlabROW = SpecSlabVO.next();
  79. String MillFl = (String)SpecSlabROW.getAttribute("MILL_FL");
  80. if(MillFl != null && MillFl.equals("Y")) {
  81. SendProg_NIF024060( SLAB_NO[i]);
  82. }
  83. } */
  84. }
  85. }
  86. return PosBizControlConstants.SUCCESS;
  87. }
  88. //Mill Schedule delete request service call
  89. public void SendProg_NIF024060(String SlabNo )
  90. {
  91. PosContext context = new PosContext();
  92. PosMessage message = new PosMESMessageImpl();
  93. String TcId = "NIF024060";
  94. message.setTCID(TcId);
  95. message.setObject("MSG_ID",TcId);
  96. message.setObject("TYPE","S");
  97. message.setObject("FROM",SlabNo);
  98. message.setObject("TO",SlabNo);
  99. message.setObject("REG_ID","UIG040010");
  100. context.setMessage(message);
  101. this.processComponent(PosConstants.CREATE_MESSAGE, context);
  102. String transactionCode = context.getMessage().getTC();
  103. message.setTCID(TcId);
  104. String serviceName = "NIF024060";
  105. String SERVICE_POSTFIX = "-service";
  106. context.put(PosBizControlConstants.SERVICE_NAME, serviceName + SERVICE_POSTFIX);
  107. context.setMessage(message);
  108. PosBizControlIF controller = PosBizProvider.getController();
  109. controller.doSubController(context,false);
  110. }
  111. }