0e25853aed32cefa276fd309d968aeab79d64e4e.svn-base 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. package xin.glue.ui.D.D03;
  2. import java.text.DecimalFormat;
  3. import java.util.HashMap;
  4. import java.util.Map;
  5. import com.posdata.glue.biz.activity.PosActivity;
  6. import com.posdata.glue.biz.constants.PosBizControlConstants;
  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. public class InsertNewCastRow extends PosActivity {
  12. public String runActivity(PosContext context) {
  13. String[] sDb_MatTp = (String[])context.get("MatTp" ) ; //MAT_TP Àç·á±¸ºÐ(01:CAST 02:CHARGE 03:SLAB 04:SLAB-D)
  14. //String[] sDb_MatTp = null ; //MAT_TP Àç·á±¸ºÐ(01:CAST 02:CHARGE 03:SLAB 04:SLAB-D)
  15. // sDb_MatTp[0] = "01";
  16. PosParameter param = null;
  17. Map m = new HashMap();
  18. PosRow row = null;
  19. String sMaxMatSpecSeq = null;
  20. int iMaxMatSpecSeq = 1;
  21. param = new PosParameter();
  22. param.setWhereClauseParameter( 0, sDb_MatTp[0]);
  23. PosRowSet rs = getDao("mesdao").find("UID030020.MatDnRst.ByType.MaxMatSpecSeq", param);
  24. if( rs.hasNext() ) {
  25. row = rs.next();
  26. m = row.getAttributes();
  27. sMaxMatSpecSeq = (String)m.get("MAX_MAT_SPEC_SEQ");
  28. if( sMaxMatSpecSeq != null ) {
  29. iMaxMatSpecSeq = Integer.parseInt(sMaxMatSpecSeq) + 1;
  30. }
  31. sMaxMatSpecSeq = new DecimalFormat("00").format(iMaxMatSpecSeq);
  32. param = new PosParameter();
  33. param.setValueParamter( 0, sMaxMatSpecSeq );
  34. param.setValueParamter( 1, "" );
  35. param.setValueParamter( 2, sDb_MatTp[0] );
  36. param.setValueParamter( 3, "" );
  37. param.setValueParamter( 4, Integer.valueOf(sMaxMatSpecSeq) );
  38. param.setValueParamter( 5, "0" );
  39. param.setValueParamter( 6, "" );
  40. param.setValueParamter( 7, "" );
  41. param.setValueParamter( 8, "" );
  42. param.setValueParamter( 9, "" );
  43. param.setValueParamter( 10, "" );
  44. param.setValueParamter( 11, "" );
  45. param.setValueParamter( 12, "" );
  46. param.setValueParamter( 13, "" );
  47. param.setValueParamter( 14, "" );
  48. param.setValueParamter( 15, "" );
  49. param.setValueParamter( 16, "" );
  50. param.setValueParamter( 17, "" );
  51. param.setValueParamter( 18, "" );
  52. param.setValueParamter( 19, "" );
  53. param.setValueParamter( 20, "" );
  54. param.setValueParamter( 21, "" );
  55. param.setValueParamter( 22, "" );
  56. param.setValueParamter( 23, "" );
  57. param.setValueParamter( 24, "" );
  58. param.setValueParamter( 25, "" );
  59. param.setValueParamter( 26, "" );
  60. param.setValueParamter( 27, "" );
  61. param.setValueParamter( 28, "" );
  62. param.setValueParamter( 29, "" );
  63. param.setValueParamter( 30, "" );
  64. param.setValueParamter( 31, "" );
  65. param.setValueParamter( 32, "" );
  66. param.setValueParamter( 33, "" );
  67. param.setValueParamter( 34, "" );
  68. param.setValueParamter( 35, "" );
  69. param.setValueParamter( 36, "01" );
  70. param.setValueParamter( 37, "" );
  71. param.setValueParamter( 38, "" );
  72. param.setValueParamter( 39, "" );
  73. param.setValueParamter( 40, "" );
  74. param.setValueParamter( 41, "" );
  75. param.setValueParamter( 42, "" );
  76. param.setValueParamter( 43, "" );
  77. param.setValueParamter( 44, "" );
  78. param.setValueParamter( 45, "" );
  79. param.setValueParamter( 46, "" );
  80. param.setValueParamter( 47, "" );
  81. param.setValueParamter( 48, "" );
  82. getDao("mesdao").insert("UID030020.MatDnRst.Row.Insert", param);
  83. }
  84. return PosBizControlConstants.SUCCESS;
  85. }
  86. }