580bf5e6abb7246e63178b3c938043b993a8dc66.svn-base 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. package xin.glue.ui.B.B01;
  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.PosGenericDao;
  6. import com.posdata.glue.dao.vo.PosParameter;
  7. import com.posdata.glue.dao.vo.PosRowSet;
  8. /**
  9. *
  10. * @Description 增加或修改时使用{界面ID:UIB010191}
  11. * @author 梅贵平{meiguiping}
  12. * @date 2009-3-2 下午02:33:00
  13. * @JDK Version jdk1.4.2
  14. */
  15. public class SaveDefConvQlty extends PosActivity
  16. {
  17. public String runActivity(PosContext context)
  18. {
  19. PosParameter param = null;
  20. PosGenericDao dao = this.getDao("mesdao");
  21. PosRowSet rowset = null;
  22. ///insert
  23. String[]PRDNM_CD = (String[])context.get("PRDNM_CD");//品名
  24. String[]SPEC_ABBSYM = (String[])context.get("SPEC_ABBSYM");//标准号
  25. String[]QLTYX = (String[])context.get("QLTYX");
  26. System.out.println("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@");
  27. if(PRDNM_CD != null)
  28. {
  29. int len = QLTYX.length;
  30. String qq = "";//保存材质代码
  31. String ss = "";//保存smp_lot_cd
  32. for(int i = 0; i < len; i++)
  33. {
  34. System.out.println("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! "+QLTYX[i]);
  35. qq = QLTYX[i].split("\\|")[0];
  36. if(ss != null && !"".equals(ss))//SMP_LOT_CD值不允许为空
  37. {
  38. ss = QLTYX[i].split("\\|")[1];
  39. param = new PosParameter();
  40. param.setValueParamter(0, PRDNM_CD[0]);//品名
  41. param.setValueParamter(1, SPEC_ABBSYM[0]);//标准号
  42. param.setValueParamter(2, qq);//材质代码
  43. param.setValueParamter(3, ss);//取样代码
  44. dao.insert("UIB010191_01.INSERT", param);
  45. }
  46. }
  47. }
  48. ///updae
  49. String[] PRDNMCD = (String[])context.get("PRDNMCD");//交货状态
  50. String[] SPECABBSYM = (String[])context.get("SPECABBSYM");//标准号
  51. String[] LOC = (String[])context.get("LOC");//材质项目
  52. if(PRDNMCD == null)
  53. return PosBizControlConstants.SUCCESS;
  54. int len = PRDNMCD.length;
  55. String qltyCD = "";
  56. String smpLot = "";
  57. for(int i = 0; i < len; i++)
  58. {
  59. qltyCD = LOC[i].split("\\|")[0];//材质代码
  60. smpLot = LOC[i].split("\\|")[1];//取样方式
  61. System.out.println("######################################## "+i+" "+qltyCD);
  62. System.out.println("######################################## "+i+" "+smpLot);
  63. param = new PosParameter();
  64. param.setWhereClauseParameter(0, PRDNMCD[i]);
  65. param.setWhereClauseParameter(1, SPECABBSYM[i]);
  66. param.setWhereClauseParameter(2, qltyCD);
  67. rowset = dao.find("UIB010191_05.SELECT", param);
  68. if(rowset.count()==0 && !"".equals(smpLot))//insert
  69. {
  70. param = new PosParameter();
  71. param.setValueParamter(0, PRDNMCD[i]);
  72. param.setValueParamter(1, SPECABBSYM[i]);
  73. param.setValueParamter(2, qltyCD);
  74. param.setValueParamter(3, smpLot);
  75. dao.insert("UIB010191_01.INSERT", param);
  76. }
  77. if(rowset.count()!= 0 && !"".equals(smpLot))//update
  78. {
  79. param = new PosParameter();
  80. param.setWhereClauseParameter(0, smpLot);
  81. param.setWhereClauseParameter(1, PRDNMCD[i]);
  82. param.setWhereClauseParameter(2, SPECABBSYM[i]);
  83. param.setWhereClauseParameter(3, qltyCD);
  84. dao.update("UIB010191_01.UPDATE" , param);
  85. }
  86. if(rowset.count()!= 0 && "".equals(smpLot))//delete
  87. {
  88. param = new PosParameter();
  89. param.setValueParamter(0, PRDNMCD[i]);
  90. param.setValueParamter(1, SPECABBSYM[i]);
  91. param.setValueParamter(2, qltyCD);
  92. dao.delete("UIB010191_01.DELETE", param);
  93. }
  94. }
  95. return PosBizControlConstants.SUCCESS;
  96. }
  97. }