70499241657dd7c8039edccb797bb40d9932de1b.svn-base 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. package xin.glue.ui.B.B02;
  2. import java.util.ArrayList;
  3. import java.util.HashMap;
  4. import com.posdata.glue.biz.activity.PosActivity;
  5. import com.posdata.glue.biz.constants.PosBizControlConstants;
  6. import com.posdata.glue.context.PosContext;
  7. import com.posdata.glue.dao.PosGenericDao;
  8. import com.posdata.glue.dao.PosJdbcDao;
  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 xin.glue.ui.B.common.SqlTools;
  13. public class FindSMPStatus extends PosActivity {
  14. public String runActivity(PosContext context) {
  15. PosGenericDao dao = this.getDao("mesdao");
  16. PosRowSet rowSet0= null;
  17. PosRowSet rowSet1= null;
  18. PosRowSet rowSet2= null;
  19. PosParameter param = null;
  20. PosRow row = null;
  21. String[] date = (String[])context.get("date");
  22. param = new PosParameter();
  23. param.setWhereClauseParameter(0, date[0]);
  24. param.setWhereClauseParameter(1, date[0]);
  25. param.setWhereClauseParameter(2, date[0]);
  26. param.setWhereClauseParameter(3, date[0]);
  27. rowSet0 = dao.find("UIB020260_01.SELECT", param);
  28. context.put("SMPRESULT" , rowSet0);
  29. rowSet0.reset();
  30. param = new PosParameter();
  31. param.setWhereClauseParameter(0, date[0]);
  32. param.setWhereClauseParameter(1, date[0]);
  33. rowSet0 = dao.find("UIB020260_02.SELECT", param);
  34. param = new PosParameter();
  35. param.setWhereClauseParameter(0, date[0]);
  36. rowSet1 = dao.find("UIB020260_03.SELECT", param);
  37. param = new PosParameter();
  38. param.setWhereClauseParameter(0, date[0]);
  39. rowSet2 = dao.find("UIB020260_04.SELECT", param);
  40. HashMap map;
  41. ArrayList list = new ArrayList();
  42. int i = 0;
  43. while(rowSet0.hasNext())
  44. {
  45. map = new HashMap();
  46. row = rowSet0.next();
  47. String CNT1 = (!"".equals( row.getAttribute("CNT1")))?(String)row.getAttribute("CNT1"):"";
  48. String CNT2 = (!"".equals( row.getAttribute("CNT2")))?(String)row.getAttribute("CNT2"):"";
  49. String CNT3 = (!"".equals( row.getAttribute("CNT3")))?(String)row.getAttribute("CNT3"):"";
  50. String CNT4 = (!"".equals( row.getAttribute("CNT4")))?(String)row.getAttribute("CNT4"):"";
  51. map.put("CNT1",CNT1);
  52. map.put("CNT2",CNT2);
  53. map.put("CNT3",CNT3);
  54. map.put("CNT4",CNT4);
  55. if(i == 0)
  56. {
  57. int count = 1;
  58. while(rowSet1.hasNext())
  59. {
  60. row = rowSet1.next();
  61. String QLTY_CD;
  62. String CNT;
  63. QLTY_CD = (!"".equals( row.getAttribute("QLTY_CD")))?
  64. (String)row.getAttribute("QLTY_CD"):"";
  65. CNT = (!"".equals( row.getAttribute("CNT")))?
  66. (String)row.getAttribute("CNT"):"";
  67. map.put("CNT3_"+count, QLTY_CD+" "+CNT);
  68. count++;
  69. }
  70. if(!rowSet1.hasNext())
  71. {
  72. for(int lcnt = 1;lcnt < 7;lcnt++)
  73. {
  74. map.put("CNT3_"+lcnt,"");
  75. }
  76. }
  77. }
  78. if(i == 1)
  79. {
  80. int count = 1;
  81. while(rowSet2.hasNext())
  82. {
  83. row = rowSet2.next();
  84. String QLTY_CD;
  85. String CNT;
  86. QLTY_CD = !"".equals( row.getAttribute("QLTY_CD"))?
  87. (String)row.getAttribute("QLTY_CD"):"";
  88. CNT = !"".equals( row.getAttribute("CNT"))?
  89. (String)row.getAttribute("CNT"):"";
  90. map.put("CNT3_"+count, QLTY_CD+" "+CNT);
  91. count++;
  92. }
  93. }
  94. i++;
  95. list.add(map);
  96. }
  97. context.put("QLTYRESULT" , list);
  98. return PosBizControlConstants.SUCCESS;
  99. }
  100. }