19 package org.turro.erp.time;
22 import java.io.FileNotFoundException;
23 import java.util.Date;
24 import java.util.List;
25 import java.util.logging.Level;
26 import java.util.logging.Logger;
27 import org.amic.util.date.CheckDate;
28 import org.turro.elephant.context.Application;
29 import org.turro.elephant.context.ElephantContext;
30 import org.turro.elephant.impl.util.FileUtil;
31 import org.turro.erp.db.ErpPU;
32 import org.turro.erp.entity.HumanResource;
33 import org.turro.erp.entity.TimeControl;
34 import org.turro.erp.task.Workload;
35 import org.turro.jpa.Dao;
36 import org.zkoss.text.DateFormats;
37 import org.zkoss.zk.ui.Component;
38 import org.zkoss.zk.ui.event.Event;
39 import org.zkoss.zk.ui.select.SelectorComposer;
40 import org.zkoss.zk.ui.select.annotation.Listen;
41 import org.zkoss.zk.ui.select.annotation.Wire;
42 import org.zkoss.zul.Filedownload;
43 import org.zkoss.zul.Hlayout;
44 import org.zkoss.zul.Label;
45 import org.zkoss.zul.Tab;
53 @Wire
private Tab tabHr;
54 @Wire
private Tab tabTask;
55 @Wire
private Tab tabReport;
56 @Wire
private Hlayout info;
61 @Wire
private Label currDay;
64 private Date currDate =
new Date();
66 @Listen(
"onChange = #hrList")
69 if(selected !=
null) {
70 taskList.setHumanResource(selected);
71 info.getChildren().clear();
72 info.appendChild(
new Label(selected.
getName()));
73 tabTask.setSelected(
true);
77 @Listen(
"onChange = #taskList")
79 Object obj = evt.getData();
84 tabHr.setSelected(
true);
91 tabHr.setSelected(
true);
95 @Listen(
"onUser = #taskList")
97 if(selected !=
null) {
101 tabHr.setSelected(
true);
105 @Listen(
"onCancel = #taskList")
107 tabHr.setSelected(
true);
110 @Listen(
"onClick = #export")
113 List<HumanResource> list = dao.getResultList(
114 "select hr from HumanResource as hr where hr.active = true order by hr.name");
120 xhr.
setId(hr.getId());
128 Filedownload.save(file,
"text/xml");
129 }
catch (FileNotFoundException ex) {
134 @Listen(
"onClick = #report")
136 tabReport.setSelected(
true);
137 currDay.setValue(DateFormats.format(currDate,
true));
141 @Listen(
"onClick = #prevDay")
143 currDate =
new CheckDate(currDate).addDays(-1).getDate();
144 currDay.setValue(DateFormats.format(currDate,
true));
148 @Listen(
"onClick = #nextDay")
150 currDate =
new CheckDate(currDate).addDays(1).getDate();
151 currDay.setValue(DateFormats.format(currDate,
true));
155 @Listen(
"onClick = #back")
157 tabHr.setSelected(
true);
IConstructor getConstructor()
static Application getApplication()
static String getRealPath(String path)
static File getFolderFile(File file)
void onHumanResourceSelect(Event evt)
void setHumanResource(HumanResource humanResource)
TimeControl end(TimeControl tc)
static final String XML_HUMANRESOURCE
void setName(String name)