f4e29e7e0eb30116f099b0d2d1d305c7fb7a2c3b.svn-base 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. package xin.glue.ui.D.D01;
  2. import com.posdata.glue.biz.activity.PosActivity;
  3. import com.posdata.glue.biz.constants.PosBizControlConstants;
  4. import com.posdata.glue.context.PosContext;
  5. import com.posdata.glue.dao.vo.PosParameter;
  6. import com.posdata.glue.dao.vo.PosRowSet;
  7. /**
  8. * 板坏设计结果的保存
  9. * @author 王黎
  10. * @date 2008-9-6
  11. */
  12. public class SaveSlabResInfo extends PosActivity
  13. {
  14. public String runActivity(PosContext context)
  15. {
  16. //从页面获取一系列参数,供更新数据所用
  17. String[] chk = (String[]) context.get("CHK");
  18. String[] DSN_SLAB_NO = (String[]) context.get("DSN_SLAB_NO");//板坏号
  19. String[] P_DSN_SLAB_NO = (String[]) context.get("P_DSN_SLAB_NO");//组合板坏号
  20. String[] ORD_NO = (String[]) context.get("ORD_NO");
  21. String[] ORD_SEQ = (String[]) context.get("ORD_SEQ");
  22. String[] SLAB_WTH = (String[]) context.get("SLAB_WTH");
  23. String[] SLAB_THK = (String[]) context.get("SLAB_THK");
  24. String[] SLAB_LEN = (String[]) context.get("SLAB_LEN");
  25. String[] SLAB_WGT = (String[]) context.get("SLAB_WGT");
  26. String[] SLAB_TRMTH_TP = (String[]) context.get("SLAB_TRMTH_TP");
  27. String[] AUTODSN_YN = (String[]) context.get("AUTODSN_YN");
  28. String[] EMGMTR_YN = (String[]) context.get("EMGMTR_YN");
  29. String[] COIL_PACK_WGT_MIN = (String[]) context.get("COIL_PACK_WGT_MIN");
  30. String[] COIL_PACK_WGT_MAX = (String[]) context.get("COIL_PACK_WGT_MAX");
  31. String[] HCR_YN = (String[]) context.get("HCR_YN");
  32. String[] GRAVITY = (String[]) context.get("GRAVITY");
  33. //String[] SPEC_ABBSYMBL = (String[]) context.get("SPEC_ABBSYMBL");
  34. //String[] SPEC_STL_GRD = (String[]) context.get("SPEC_STL_GRD");
  35. String[] FAC_STL_GRD = (String[]) context.get("FAC_STL_GRD");
  36. //String[] PRDNM_CD = (String[]) context.get("PRDNM_CD");
  37. String[] COIL_THK = (String[]) context.get("COIL_THK");
  38. String[] COIL_WTH = (String[]) context.get("COIL_WTH");
  39. String[] COIL_LEN = (String[]) context.get("COIL_LEN");
  40. String[] COIL_WGT = (String[]) context.get("COIL_WGT");
  41. String[] PROC_PATH = (String[]) context.get("PROC_PATH");
  42. String[] FAC_STL_GRP = (String[]) context.get("FAC_STL_GRP");
  43. String[] COMB_YN = (String[]) context.get("COMB_YN");
  44. //组织三个参数群,分别供查询,更新和插入数据所用
  45. PosParameter parameter = null;
  46. PosRowSet rowSet = null;
  47. if (chk != null)
  48. {
  49. for (int i = 0; i < chk.length; i++)
  50. {
  51. //更新参数
  52. parameter = new PosParameter();
  53. parameter.setValueParamter(0, SLAB_WTH[i]);
  54. parameter.setValueParamter(1, SLAB_THK[i]);
  55. parameter.setValueParamter(2, SLAB_LEN[i]);
  56. parameter.setValueParamter(3, SLAB_WGT[i]);
  57. parameter.setValueParamter(4, SLAB_TRMTH_TP[i]);
  58. parameter.setValueParamter(5, AUTODSN_YN[i]);
  59. parameter.setValueParamter(6, EMGMTR_YN[i]);
  60. parameter.setValueParamter(7, COIL_PACK_WGT_MIN[i]);
  61. parameter.setValueParamter(8, COIL_PACK_WGT_MAX[i]);
  62. //parameter.setValueParamter(7, "0");
  63. //parameter.setValueParamter(8, "0");
  64. parameter.setValueParamter(9, HCR_YN[i]);
  65. parameter.setValueParamter(10, GRAVITY[i]);
  66. //parameter.setValueParamter(11, SPEC_ABBSYMBL[i]);
  67. //parameter.setValueParamter(12, SPEC_STL_GRD[i]);
  68. parameter.setValueParamter(11, FAC_STL_GRD[i]);
  69. //parameter.setValueParamter(13, PRDNM_CD[i]);
  70. parameter.setValueParamter(12, COIL_THK[i]);
  71. parameter.setValueParamter(13, COIL_WTH[i]);
  72. parameter.setValueParamter(14, COIL_LEN[i]);
  73. parameter.setValueParamter(15, COIL_WGT[i]);
  74. parameter.setValueParamter(16, PROC_PATH[i]);
  75. if(P_DSN_SLAB_NO == null)
  76. {
  77. parameter.setValueParamter(17,"");
  78. }
  79. else
  80. {
  81. parameter.setValueParamter(17, P_DSN_SLAB_NO[i]);
  82. }
  83. parameter.setValueParamter(18, FAC_STL_GRP[i]);
  84. //parameter.setValueParamter(18, "");
  85. parameter.setValueParamter(19, COMB_YN[i]);
  86. parameter.setValueParamter(20, ORD_SEQ[i]);
  87. parameter.setValueParamter(21, ORD_NO[i]);
  88. parameter.setValueParamter(22, DSN_SLAB_NO[i]);
  89. //先判断表中是否存在该主键的条记录,如果存在,则只用更新就可以,如果不存在,则需重新插入
  90. String sql = "SELECT DSN_SLAB_NO FROM TBD01_SLABDN_RST WHERE DSN_SLAB_NO='"+DSN_SLAB_NO[i] +"'";
  91. rowSet = getDao("mesdao").findByQueryStatement(sql);
  92. if(rowSet.hasNext())
  93. {
  94. getDao("mesdao").update("tbd01_slabdn_rst.update", parameter);
  95. }
  96. else
  97. {
  98. getDao("mesdao").insert("tbd01_slabdn_rst.insert", parameter);
  99. }
  100. }
  101. }
  102. return PosBizControlConstants.SUCCESS;
  103. }
  104. }