123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081 |
- package inbasis.ui.opticket;
- import inbasis.domain.windfarm.Windfarm;
- import inbasis.system.IBSServer;
- import inbasis.system.ui.SearchWindow;
- import inbasis.system.ui.common.SCombobox;
- import inbasis.system.ui.common.SEDatebox;
- import inbasis.system.ui.common.SSDatebox;
- import inbasis.util.DateUtil;
- import inbasis.util.Util;
- import java.text.SimpleDateFormat;
- import java.util.Calendar;
- import java.util.Date;
- import java.util.List;
- import java.util.Map;
- public class OpticketRptWindow extends SearchWindow {
- private static final long serialVersionUID = -6720100007092979186L;
-
-
- @SuppressWarnings("static-access")
- @Override
- public void onCreate() throws Exception {
- super.onCreate();
- SCombobox windfarm = (SCombobox)this.getFellow("windfarm");
- List<Windfarm> list = IBSServer.getIBSServer().getBaseDao().findWithQuery(Windfarm.class,"wfname!='集控中心'");
- for(Windfarm l:list){
- windfarm.appendItem(l.getWfname());
- if(this.getLaborInfo().getDeptnum().equals(l.getWfname())){
- windfarm.setValue(l.getWfname());
- }
- }
-
- /*String str[] = {"风机工作票","电气第一种工作票","电气第二种工作票","动火工作票"};
- for(int i=0;i<str.length;i++){
- type.appendItem(str[i]);
- }*/
- }
-
- @Override
- public void search() throws Exception {
-
- SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
- SCombobox smon = (SCombobox) this.getFellow("windfarm");
- String somon = smon.getValue();
- if(Util.isNull(somon))
- {
- ((Map) this.getSearchList().get("windfarm")).put("value", "");
- }else{
- ((Map) this.getSearchList().get("windfarm")).put("value", somon);
- }
-
-
- SSDatebox beginBox = (SSDatebox) this.getFellow("s_begin");
- Date begin = beginBox.getValue();
- if(begin == null){
- throw new Exception("报表条件'操作开始时间'不能为空,请确认!");
- }else{
- ((Map) this.getSearchList().get("s_begin")).put("value", sdf.format(begin)+" 00:00:00");
- }
-
- SEDatebox endBox = (SEDatebox) this.getFellow("e_end");
- Date end = endBox.getValue();
- if(end == null){
- throw new Exception("报表条件'操作结束时间'不能为空,请确认!");
- }else{
- ((Map) this.getSearchList().get("e_end")).put("value", sdf.format(end)+" 23:59:59");
- }
-
-
- if(begin.getTime()> end.getTime()){
- throw new Exception("报表条件开始时间不能在结束时间之后,请确认!");
- }
-
- super.search();
- }
- }
|