ecfc0cf45c877be14a69dd6fd2d4c56320f16865.svn-base 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. package xin.glue.ui.B.B02;
  2. import java.sql.CallableStatement;
  3. import com.posdata.glue.biz.activity.PosActivity;
  4. import com.posdata.glue.biz.constants.PosBizControlConstants;
  5. import com.posdata.glue.context.PosContext;
  6. import com.posdata.glue.dao.PosGenericDao;
  7. import com.posdata.glue.dao.vo.PosParameter;
  8. import com.posdata.glue.dao.vo.PosRowSet;
  9. /**
  10. *
  11. * @Description 复样信息保存{界面ID:UIB020150}
  12. * @author 梅贵平{meiguiping}
  13. * @date 2008-11-19 上午10:49:48
  14. * @JDK Version jdk1.4.2
  15. */
  16. public class SaveRESampling extends PosActivity
  17. {
  18. public String runActivity(PosContext context)
  19. {
  20. PosGenericDao dao = this.getDao("mesdao");
  21. PosParameter param = null;
  22. String[]rowStatus = (String[])context.get("rowStatus");
  23. String[]CHK = (String[])context.get("CHK");//是否被选择,只有被选择的才能被更新
  24. String[]COIL_NO = (String[])context.get("COIL_NO");//复样对应的钢卷号(复样取自的某钢卷)
  25. String[]REASON = (String[])context.get("REASON");
  26. String[]QUYANGJUAN = (String[])context.get("QUYANGJUAN");//复样取样卷
  27. String[]NOResamp = (String[])context.get("NOResamp");
  28. String[]SMP_NO = (String[])context.get("SMP_NO");
  29. //复样
  30. if(rowStatus != null)
  31. {
  32. CallableStatement cstm = null;
  33. int len = rowStatus.length;
  34. cstm = dao.getCallableStatement("UIB020150_01.CALLSTATEMENT");
  35. for(int i = 0; i < len; i++)
  36. {
  37. if("Y".equals(QUYANGJUAN[i]))
  38. {
  39. try
  40. {
  41. cstm.setString(1, COIL_NO[i]);
  42. cstm.setString(2, "");
  43. cstm.registerOutParameter(3, java.sql.Types.VARCHAR);
  44. cstm.registerOutParameter(4, java.sql.Types.VARCHAR);
  45. cstm.execute();
  46. }
  47. catch(Exception ex)
  48. {
  49. ex.printStackTrace();
  50. }
  51. finally
  52. {
  53. if(cstm != null)
  54. {
  55. try
  56. {
  57. cstm.close();
  58. }
  59. catch(Exception e)
  60. {
  61. e.printStackTrace();
  62. }
  63. }
  64. }
  65. }
  66. }
  67. }
  68. String[]rowStatus1 = (String[])context.get("rowStatus1");
  69. //不做复样
  70. if(rowStatus1 != null)
  71. {
  72. param = new PosParameter();
  73. param.setWhereClauseParameter(0, SMP_NO[0]);
  74. dao.update("UIB020150_01.UPDATE", param);
  75. }
  76. return PosBizControlConstants.SUCCESS;
  77. }
  78. }