fe016c3dfbb858356f2b74d31db0e63572ceaa2d.svn-base 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233
  1. package xin.glue.nui.G.G02;
  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 xin.glue.ui.common.PosDateFormat;
  15. /*
  16. * author:wangxiaoyan
  17. * Date:08-10-28
  18. * desc: 钢水回送实绩
  19. */
  20. public class XinSaveReturnCharge extends PosActivity
  21. {
  22. public String runActivity(PosContext context)
  23. {
  24. PosMessage message = context.getMessage();
  25. String MSG_CHRGE_NO = (String)message.get("CHARGE_NO" );
  26. String MSG_PLAN_CHARGE_NO = (String)message.get("PLAN_CHARGE_NO" );
  27. String MSG_RTN_CHARGE_OCR_PROC = (String)message.get("RTN_CHARGE_OCR_PROC" );
  28. String MSG_RTN_CHARGE_OCR_DTIME = (String)message.get("RTN_CHARGE_OCR_DTIME" );
  29. BigDecimal MSG_RTN_CHARGE_WGT = (BigDecimal)message.get("RTN_CHARGE_WGT" );
  30. String MSG_RTN_CHARGE_CAUSE_CD = (String)message.get("RTN_CHARGE_CAUSE_CD" );
  31. logger.logInfo("XinSaveReturnCharge---> MSG_PLAN_CHARGE_NO:"+MSG_PLAN_CHARGE_NO );
  32. PosParameter param0 = new PosParameter();
  33. PosParameter param1 = new PosParameter();
  34. param1.setValueParamter(0,MSG_RTN_CHARGE_OCR_DTIME );
  35. param1.setValueParamter(1,MSG_RTN_CHARGE_CAUSE_CD );
  36. param1.setValueParamter(2,MSG_RTN_CHARGE_WGT );
  37. param1.setValueParamter(3,MSG_RTN_CHARGE_OCR_PROC );
  38. param1.setValueParamter(4,MSG_CHRGE_NO );
  39. // 修改炉次公共表
  40. this.getDao("mesdao").update("NIG020630_CHARGE_COM.update",param1);
  41. // Product control system table update
  42. // TBF01_SPEC_CHARGE,TBF01_CHARGE_IDX,TBF01_SPEC_SLAB,TBF01_SPEC_SLAB_D
  43. // if slab cutting result is existing then there are can not that's update
  44. param0.setWhereClauseParameter(0, MSG_PLAN_CHARGE_NO);
  45. PosRowSet SpecChVo = getDao("mesdao").find("NIG020610_SLAB_SPEC.select", param0);
  46. while (SpecChVo.hasNext() ) {
  47. PosParameter paramA = new PosParameter();
  48. paramA.setWhereClauseParameter(0, MSG_PLAN_CHARGE_NO);
  49. PosRowSet SlabVo = getDao("mesdao").find("NIG020610_SLAB_COMM.select", paramA);
  50. if (!SlabVo.hasNext()) {
  51. PosRow SpecChROW = SpecChVo.next();
  52. Number nSlabEdtSeq = (Number)SpecChROW.getAttribute("SLAB_EDT_SEQ");
  53. String SlabManaNo = (String)SpecChROW.getAttribute("SLAB_MANA_NO");
  54. PosParameter param2 = new PosParameter();
  55. param2.setValueParamter(0, "C" );
  56. param2.setValueParamter(1, SlabManaNo.substring(0,9) );
  57. this.getDao("mesdao").update("NIG020610_SPEC_SLAB.update", param2);
  58. PosParameter param3 = new PosParameter();
  59. param3.setValueParamter(0, "C" );
  60. param3.setValueParamter(1, nSlabEdtSeq );
  61. this.getDao("mesdao").update("NIG020610_SPEC_SLAB_D.update", param3);
  62. }
  63. }
  64. String CurProgCd = null;
  65. String BefProgCd = null;
  66. PosParameter param6 = new PosParameter();
  67. param6.setWhereClauseParameter(0, MSG_CHRGE_NO);
  68. PosRowSet chComVo = getDao("mesdao").find("NIG020630_CHARGE_COM.select", param6);
  69. if (chComVo.hasNext()) {
  70. PosRow chComROW = chComVo.next();
  71. CurProgCd = (String)chComROW.getAttribute("CUR_PROG_CD");
  72. BefProgCd = (String)chComROW.getAttribute("BEF_PROG_CD");
  73. }
  74. PosParameter param4 = new PosParameter();
  75. param4.setValueParamter(0, "C");
  76. param4.setValueParamter(1, CurProgCd );
  77. param4.setValueParamter(2, MSG_PLAN_CHARGE_NO );
  78. this.getDao("mesdao").update("NIG020610_SPEC_CHARGE.update", param4);
  79. PosParameter param5 = new PosParameter();
  80. param5.setValueParamter(0, "C" );
  81. param5.setValueParamter(1, MSG_PLAN_CHARGE_NO );
  82. this.getDao("mesdao").update("NIG020610_SPEC_CHARGE_IDX.update", param5);
  83. PosParameter param7= new PosParameter();
  84. param7.setValueParamter(0, MSG_CHRGE_NO );
  85. this.getDao("mesdao").update("NIG020630_SLAB_COMM.update", param7);
  86. // Progress system sub-service call
  87. SendProg_NIE012070( MSG_PLAN_CHARGE_NO,null,null,CurProgCd,BefProgCd,MSG_RTN_CHARGE_WGT );
  88. SendProg_NIE012080();
  89. return PosBizControlConstants.SUCCESS;
  90. }
  91. public PosContext SendProg_NIE012070(String MatNo,String sOrdNo,String sOrdSeq,String sCurProg,String sBefProg,BigDecimal wgt )
  92. {
  93. logger.logInfo("XinSaveCcmResult SendProg_NIE012070 " );
  94. PosContext context = new PosContext();
  95. PosMessage message = new PosMESMessageImpl();
  96. String TcId = "NIE012070";
  97. message.setTCID(TcId);
  98. message.setObject("MSG_ID",TcId);
  99. message.setObject("BEF_ORD_NO",null);
  100. message.setObject("BEF_ORD_SEQ",null);
  101. message.setObject("ORD_NO",null);
  102. message.setObject("ORD_SEQ",null);
  103. message.setObject("BEF_PROG_CD",sBefProg);
  104. message.setObject("PROG_CD",sCurProg);
  105. message.setObject("MAT_TYPE","CH");
  106. message.setObject("MAT_NO",MatNo);
  107. message.setObject("WGT",wgt);
  108. message.setObject("PGMID","XinSaveReturnCharge");
  109. message.setObject("REG_ID","LEVEL2");
  110. context.setMessage(message);
  111. this.processComponent(PosConstants.CREATE_MESSAGE, context);
  112. String transactionCode = context.getMessage().getTC();
  113. logger.logInfo("XinSaveCcmResult---> transactionCode:("+transactionCode+")" );
  114. message.setTCID(TcId);
  115. String serviceName = "NIE012070";
  116. String SERVICE_POSTFIX = "-service";
  117. context.put(PosBizControlConstants.SERVICE_NAME, serviceName + SERVICE_POSTFIX);
  118. context.setMessage(message);
  119. PosBizControlIF controller = PosBizProvider.getController();
  120. controller.doSubController(context,false);
  121. logger.logInfo("XinSaveCcmResult---> NIE012070 TC SendProgress end" );
  122. return null;
  123. }
  124. public PosContext SendProg_NIE012080()
  125. {
  126. logger.logInfo("XinSaveCcmResult SendProg_NIE012080 " );
  127. PosContext context = new PosContext();
  128. PosMessage message = new PosMESMessageImpl();
  129. String TcId = "NIE012080";
  130. message.setTCID(TcId);
  131. message.setObject("MSG_ID",TcId);
  132. message.setObject("AA",null);
  133. context.setMessage(message);
  134. this.processComponent(PosConstants.CREATE_MESSAGE, context);
  135. String transactionCode = context.getMessage().getTC();
  136. logger.logInfo("XinSaveChargeProc---> transactionCode:("+transactionCode+")" );
  137. message.setTCID(TcId);
  138. String serviceName = "NIE012080";
  139. String SERVICE_POSTFIX = "-service";
  140. context.put(PosBizControlConstants.SERVICE_NAME, serviceName + SERVICE_POSTFIX);
  141. context.setMessage(message);
  142. PosBizControlIF controller = PosBizProvider.getController();
  143. controller.doSubController(context,false);
  144. logger.logInfo("XinSaveChargeProc---> NIE012080 TC SendProgress end" );
  145. return null;
  146. }
  147. }