ShiftoperationRptWindow.java.r17810 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. /**
  2. * <p>文件名: Targetbug1Window.java</p>
  3. * <p>版权: </p>
  4. * <p>公司: company Co., Ltd.</p>
  5. * <p>项目名:fdeam</p>
  6. * <p>作者: 刘厦(liusha.information@gmail.com)</p>
  7. */
  8. package inbasis.ui.running;
  9. import inbasis.domain.windfarm.Windfarm;
  10. import inbasis.system.IBSServer;
  11. import inbasis.system.ui.SearchWindow;
  12. import inbasis.system.ui.common.SCombobox;
  13. import inbasis.system.ui.common.SEDatebox;
  14. import inbasis.system.ui.common.SSDatebox;
  15. import inbasis.util.Util;
  16. import java.text.SimpleDateFormat;
  17. import java.util.Calendar;
  18. import java.util.Date;
  19. import java.util.List;
  20. import java.util.Map;
  21. import org.aspectj.weaver.patterns.ScopeWithTypeVariables;
  22. import com.inbasis.zul.Datebox;
  23. /**
  24. * <p>
  25. * Targetbug1Window
  26. * </p>
  27. * <p>
  28. * 说明:
  29. * </p>
  30. *
  31. * @author 刘厦(liusha.information@gmail.com)
  32. * @version 0.0.0
  33. * <table style="border:1px solid gray;">
  34. * <tr>
  35. * <th width="100px">版本号</th>
  36. * <th width="100px">动作</th>
  37. * <th width="100px">修改人</th>
  38. * <th width="100px">修改时间</th>
  39. * </tr>
  40. * <!-- 以 Table 方式书写修改历史 -->
  41. * <tr>
  42. * <td>0.0.0</td>
  43. * <td>创建类</td>
  44. * <td>刘厦</td>
  45. * <td>Nov 8, 20126:32:07 PM</td>
  46. * </tr>
  47. * <tr>
  48. * <td></td>
  49. * <td></td>
  50. * <td></td>
  51. * <td></td>
  52. * </tr>
  53. * </table>
  54. */
  55. public class ShiftoperationRptWindow extends SearchWindow {
  56. private static final long serialVersionUID = -6720100007092979186L;
  57. @SuppressWarnings("static-access")
  58. @Override
  59. public void onCreate() throws Exception {
  60. super.onCreate();
  61. SSDatebox begin = (SSDatebox) this.getFellow("s_begin");
  62. SEDatebox end = (SEDatebox) this.getFellow("e_end");
  63. end.setValue(new Date());
  64. Calendar c = Calendar.getInstance();
  65. c.setTime(new Date());
  66. c.add(Calendar.MONTH,-1);
  67. begin.setValue(c.getTime());
  68. /*SCombobox windfarm = (SCombobox)this.getFellow("windfarm");
  69. List<Windfarm> list = IBSServer.getIBSServer().getBaseDao().findWithQuery(Windfarm.class,"wfname!='集控中心'");
  70. for(Windfarm l:list){
  71. windfarm.appendItem(l.getWfname());
  72. if(this.getLaborInfo().getDeptnum().equals(l.getWfname())){
  73. windfarm.setValue(l.getWfname());
  74. }
  75. }*/
  76. }
  77. @Override
  78. public void search() throws Exception {
  79. SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
  80. /*SCombobox smon = (SCombobox) this.getFellow("windfarm");
  81. String somon = smon.getValue();
  82. if(Util.isNull(somon))
  83. {
  84. ((Map) this.getSearchList().get("windfarm")).put("value", "");
  85. }else{
  86. ((Map) this.getSearchList().get("windfarm")).put("value", somon);
  87. }*/
  88. SSDatebox beginBox = (SSDatebox) this.getFellow("s_begin");
  89. Date begin = beginBox.getValue();
  90. if(begin == null){
  91. throw new Exception("报表条件'查询开始日期'不能为空,请确认!");
  92. }else{
  93. ((Map) this.getSearchList().get("s_begin")).put("value", sdf.format(begin)+" 00:00:00");
  94. }
  95. SEDatebox endBox = (SEDatebox) this.getFellow("e_end");
  96. Date end = endBox.getValue();
  97. if(end == null){
  98. throw new Exception("报表条件'查询结束日期'不能为空,请确认!");
  99. }else{
  100. ((Map) this.getSearchList().get("e_end")).put("value", sdf.format(end)+" 23:59:59");
  101. }
  102. String str = this.searchString;
  103. super.search();
  104. }
  105. }