added euCanSHare wp
This commit is contained in:
		| @@ -10,13 +10,17 @@ public class DailySummaryBean { | ||||
| 	private final String moduleName; | ||||
| 	private final String jobName; | ||||
| 	private final String duration; | ||||
| 	private final String wp; | ||||
| 	private final Double durationHours; | ||||
|  | ||||
| 	public DailySummaryBean(String projectName, String moduleName, String jobName, String duration) { | ||||
| 	public DailySummaryBean(String projectName, String moduleName, String jobName, String duration, String wp, Double durationHours) { | ||||
| 		super(); | ||||
| 		this.projectName = projectName; | ||||
| 		this.moduleName = moduleName; | ||||
| 		this.jobName = jobName; | ||||
| 		this.duration = duration; | ||||
| 		this.wp = wp; | ||||
| 		this.durationHours = durationHours; | ||||
| 	} | ||||
|  | ||||
| 	public String getProjectName() { | ||||
| @@ -33,5 +37,19 @@ public class DailySummaryBean { | ||||
|  | ||||
| 	public String getDuration() { | ||||
| 		return duration; | ||||
| 	}; | ||||
| 	} | ||||
|  | ||||
|   /** | ||||
|    * @return the wp | ||||
|    */ | ||||
|   public String getWp() { | ||||
|     return wp; | ||||
|   } | ||||
|  | ||||
|   /** | ||||
|    * @return the durationHours | ||||
|    */ | ||||
|   public Double getDurationHours() { | ||||
|     return durationHours; | ||||
|   }; | ||||
| } | ||||
|   | ||||
| @@ -31,6 +31,7 @@ public class DoneBean implements Bean, Serializable, Comparable<DoneBean> { | ||||
| 	private TProjectRecord project; | ||||
| 	private TModuleRecord module; | ||||
| 	private TJobRecord activity; | ||||
| 	private String wp; | ||||
|  | ||||
| 	public DoneBean() { | ||||
| 	} | ||||
| @@ -43,6 +44,7 @@ public class DoneBean implements Bean, Serializable, Comparable<DoneBean> { | ||||
| 		this.project = projectMap.get(r.getFkProject()); | ||||
| 		this.module = moduleMap.get(r.getFkModule()); | ||||
| 		this.activity = jobMap.get(r.getFkJob()); | ||||
| 		this.wp = r.getWp(); | ||||
| 	} | ||||
|  | ||||
| 	/** | ||||
| @@ -119,6 +121,15 @@ public class DoneBean implements Bean, Serializable, Comparable<DoneBean> { | ||||
| 		return ldt; | ||||
| 	} | ||||
|  | ||||
|   public String getProjectNameWithWP() { | ||||
|     StringBuilder buf = new StringBuilder(); | ||||
|     buf.append(project == null ? "" : project.getName()); | ||||
|     if (wp != null && !wp.isBlank()) { | ||||
|       buf.append(" (").append(wp).append(")"); | ||||
|     } | ||||
|     return buf.toString(); | ||||
|   } | ||||
|  | ||||
| 	public String getProjectName() { | ||||
| 		return project == null ? "" : project.getName(); | ||||
| 	} | ||||
| @@ -196,4 +207,18 @@ public class DoneBean implements Bean, Serializable, Comparable<DoneBean> { | ||||
| 	public void setActivity(TJobRecord activity) { | ||||
| 		this.activity = activity; | ||||
| 	} | ||||
|  | ||||
|   /** | ||||
|    * @return the wp | ||||
|    */ | ||||
|   public String getWp() { | ||||
|     return wp; | ||||
|   } | ||||
|  | ||||
|   /** | ||||
|    * @param wp the wp to set | ||||
|    */ | ||||
|   public void setWp(String wp) { | ||||
|     this.wp = wp; | ||||
|   } | ||||
| } | ||||
|   | ||||
| @@ -5,8 +5,8 @@ import static de.jottyfan.timetrack.db.done.Tables.T_JOB; | ||||
| import static de.jottyfan.timetrack.db.done.Tables.T_MODULE; | ||||
| import static de.jottyfan.timetrack.db.done.Tables.T_PROJECT; | ||||
| import static de.jottyfan.timetrack.db.done.Tables.V_HAMSTERSUMMARY; | ||||
| import static de.jottyfan.timetrack.db.done.Tables.V_TASKLIST; | ||||
| import static de.jottyfan.timetrack.db.done.Tables.V_TOTALOFDAY; | ||||
| import static de.jottyfan.timetrack.db.done.Tables.V_WORKTIME; | ||||
| import static de.jottyfan.timetrack.db.profile.Tables.T_LOGIN; | ||||
|  | ||||
| import java.sql.Date; | ||||
| @@ -23,11 +23,12 @@ import org.apache.logging.log4j.LogManager; | ||||
| import org.apache.logging.log4j.Logger; | ||||
| import org.jooq.DSLContext; | ||||
| import org.jooq.DeleteConditionStep; | ||||
| import org.jooq.InsertValuesStep6; | ||||
| import org.jooq.InsertValuesStep7; | ||||
| import org.jooq.Record; | ||||
| import org.jooq.Record3; | ||||
| import org.jooq.Record4; | ||||
| import org.jooq.Record5; | ||||
| import org.jooq.Record6; | ||||
| import org.jooq.SelectConditionStep; | ||||
| import org.jooq.SelectJoinStep; | ||||
| import org.jooq.SelectWhereStep; | ||||
| @@ -202,7 +203,7 @@ public class DoneGateway extends JooqGateway { | ||||
| 		Integer fkLogin = getFkLogin(); | ||||
|  | ||||
| 		try (DSLContext jooq = getJooq()) { | ||||
| 			InsertValuesStep6<TDoneRecord, Timestamp, Timestamp, Integer, Integer, Integer, Integer> sql = jooq | ||||
| 			InsertValuesStep7<TDoneRecord, Timestamp, Timestamp, Integer, Integer, Integer, String, Integer> sql = jooq | ||||
| 			// @formatter:off | ||||
| 				.insertInto(T_DONE,  | ||||
| 										T_DONE.TIME_FROM,  | ||||
| @@ -210,8 +211,9 @@ public class DoneGateway extends JooqGateway { | ||||
| 										T_DONE.FK_PROJECT,  | ||||
| 										T_DONE.FK_MODULE,  | ||||
| 										T_DONE.FK_JOB, | ||||
| 										T_DONE.WP, | ||||
| 										T_DONE.FK_LOGIN) | ||||
| 				.values(bean.getTimeFrom(), bean.getTimeUntil(), fkProject, fkModule, fkJob, fkLogin); | ||||
| 				.values(bean.getTimeFrom(), bean.getTimeUntil(), fkProject, fkModule, fkJob, bean.getWp(), fkLogin); | ||||
| 			// @formatter:on | ||||
| 			LOGGER.debug(sql.toString()); | ||||
| 			sql.execute(); | ||||
| @@ -235,6 +237,7 @@ public class DoneGateway extends JooqGateway { | ||||
| 				.set(T_DONE.FK_PROJECT, bean.getProject() == null ? null : bean.getProject().getPk()) | ||||
| 				.set(T_DONE.FK_JOB, bean.getActivity() == null ? null : bean.getActivity().getPk()) | ||||
| 				.set(T_DONE.FK_MODULE, bean.getModule() == null ? null : bean.getModule().getPk()) | ||||
| 				.set(T_DONE.WP, bean.getWp()) | ||||
| 				.where(T_DONE.PK.eq(bean.getPk())); | ||||
| 			// @formatter:on | ||||
| 			LOGGER.debug(sql.toString()); | ||||
| @@ -304,24 +307,28 @@ public class DoneGateway extends JooqGateway { | ||||
| 	 */ | ||||
| 	public List<DailySummaryBean> getAllJobs(java.util.Date day) throws DataAccessException, ClassNotFoundException, SQLException { | ||||
| 		try (DSLContext jooq = getJooq()) { | ||||
| 			SelectConditionStep<Record4<String, String, String, String>> sql = jooq | ||||
| 			SelectConditionStep<Record6<String, Double, String, String, String, String>> sql = jooq | ||||
| 			// @formatter:off | ||||
| 				.select(V_TASKLIST.DURATION, | ||||
| 								V_TASKLIST.PROJECT_NAME, | ||||
| 								V_TASKLIST.MODULE_NAME, | ||||
| 								V_TASKLIST.JOB_NAME) | ||||
| 				.from(V_TASKLIST) | ||||
| 				.where(V_TASKLIST.DAY.eq(new SimpleDateFormat("yyyy-MM-dd").format(day))) | ||||
| 				.and(V_TASKLIST.FK_LOGIN.eq(getFkLogin())); | ||||
| 				.select(V_WORKTIME.DURATION, | ||||
| 				        V_WORKTIME.DURATION_HOURS, | ||||
| 				        V_WORKTIME.PROJECT_NAME, | ||||
| 				        V_WORKTIME.MODULE_NAME, | ||||
| 				        V_WORKTIME.JOB_NAME, | ||||
| 				        V_WORKTIME.WP) | ||||
| 				.from(V_WORKTIME) | ||||
| 				.where(V_WORKTIME.DAY.eq(new SimpleDateFormat("yyyy-MM-dd").format(day))) | ||||
| 				.and(V_WORKTIME.FK_LOGIN.eq(getFkLogin())); | ||||
| 			// @formatter:on | ||||
| 			LOGGER.debug(sql.toString()); | ||||
| 			List<DailySummaryBean> list = new ArrayList<>(); | ||||
| 			for (Record4<String, String, String, String> r : sql.fetch()) { | ||||
| 				String duration = r.get(V_TASKLIST.DURATION); | ||||
| 				String projectName = r.get(V_TASKLIST.PROJECT_NAME); | ||||
| 				String moduleName = r.get(V_TASKLIST.MODULE_NAME); | ||||
| 				String jobName = r.get(V_TASKLIST.JOB_NAME); | ||||
| 				list.add(new DailySummaryBean(projectName, moduleName, jobName, duration)); | ||||
| 			for (Record6<String, Double, String, String, String, String> r : sql.fetch()) { | ||||
| 				String duration = r.get(V_WORKTIME.DURATION); | ||||
| 				Double durationHours = r.get(V_WORKTIME.DURATION_HOURS); | ||||
| 				String projectName = r.get(V_WORKTIME.PROJECT_NAME); | ||||
| 				String moduleName = r.get(V_WORKTIME.MODULE_NAME); | ||||
| 				String jobName = r.get(V_WORKTIME.JOB_NAME); | ||||
| 				String wp = r.get(V_WORKTIME.WP); | ||||
| 				list.add(new DailySummaryBean(projectName, moduleName, jobName, duration, wp, durationHours)); | ||||
| 			} | ||||
| 			return list; | ||||
| 		} | ||||
| @@ -337,10 +344,11 @@ public class DoneGateway extends JooqGateway { | ||||
| 	 */ | ||||
| 	public String getAllCalendarEvents() throws DataAccessException, ClassNotFoundException, SQLException { | ||||
| 		try (DSLContext jooq = getJooq()) { | ||||
| 			SelectConditionStep<Record5<Timestamp, Timestamp, String, String, String>> sql = jooq | ||||
| 			SelectConditionStep<Record6<Timestamp, Timestamp, String, String, String, String>> sql = jooq | ||||
| 			// @formatter:off | ||||
| 				.select(T_DONE.TIME_FROM, | ||||
| 								T_DONE.TIME_UNTIL, | ||||
| 								T_DONE.WP, | ||||
| 								T_PROJECT.NAME, | ||||
| 								T_MODULE.NAME, | ||||
| 								T_JOB.NAME) | ||||
| @@ -356,11 +364,15 @@ public class DoneGateway extends JooqGateway { | ||||
| 				String projectName = r.get(T_PROJECT.NAME); | ||||
| 				String moduleName = r.get(T_MODULE.NAME); | ||||
| 				String jobName = r.get(T_JOB.NAME); | ||||
| 				String wp = r.get(T_DONE.WP); | ||||
| 				java.util.Date timeFrom = r.get(T_DONE.TIME_FROM); | ||||
| 				java.util.Date timeUntil = r.get(T_DONE.TIME_UNTIL); | ||||
|  | ||||
| 				StringBuilder buf = new StringBuilder(); | ||||
| 				buf.append(projectName); | ||||
| 				if (wp != null && !wp.isBlank()) { | ||||
| 				  buf.append(" (").append(wp).append(")"); | ||||
| 				} | ||||
| 				buf.append(", "); | ||||
| 				buf.append(moduleName); | ||||
| 				buf.append(": "); | ||||
|   | ||||
| @@ -208,7 +208,11 @@ public class DoneModel implements Model, Serializable { | ||||
| 		for (DailySummaryBean sdb : allJobs) { | ||||
| 			buf.append(thatday).append("\t"); | ||||
| 			buf.append(sdb.getDuration()).append("\t"); | ||||
| 			buf.append(sdb.getProjectName()).append("\t"); | ||||
| 			buf.append(sdb.getProjectName()); | ||||
| 			if (sdb.getWp() != null && !sdb.getWp().isBlank()) { | ||||
| 			  buf.append(" (").append(sdb.getWp()).append(")"); | ||||
| 			} | ||||
| 			buf.append("\t"); | ||||
| 			buf.append(sdb.getModuleName()).append("\t"); | ||||
| 			buf.append(sdb.getJobName()).append("\t"); | ||||
| 			buf.append("\n"); | ||||
|   | ||||
| @@ -41,10 +41,11 @@ | ||||
|               </ui:repeat> | ||||
|             </b:buttonGroup> | ||||
|           </h:panelGrid> | ||||
|           <b:panelGrid colSpans="4,4,4" size="xs"> | ||||
|           <b:panelGrid colSpans="3,3,3,3" size="xs"> | ||||
|             <h:outputText value="Projekt" /> | ||||
|             <h:outputText value="Modul" /> | ||||
|             <h:outputText value="Tätigkeit" /> | ||||
|             <h:outputText value="euCanShare WP" /> | ||||
|             <b:selectOneMenu id="project" value="#{doneModel.bean.project}"> | ||||
|               <f:selectItem itemValue="" itemLabel="--- bitte wählen ---" /> | ||||
|               <f:selectItems value="#{doneModel.projects}" var="i" itemValue="#{i}" itemLabel="#{i.name}" /> | ||||
| @@ -57,6 +58,12 @@ | ||||
|               <f:selectItem itemValue="" itemLabel="--- bitte wählen ---" /> | ||||
|               <f:selectItems value="#{doneModel.activities}" var="i" itemValue="#{i}" itemLabel="#{i.name}" /> | ||||
|             </b:selectOneMenu> | ||||
|             <b:selectOneMenu id="wp" value="#{doneModel.bean.wp}"> | ||||
|             	<f:selectItem itemValue="" itemLabel="---" /> | ||||
|             	<f:selectItem itemValue="WP2" itemLabel="WP2 - Opal/Mica/..." /> | ||||
|             	<f:selectItem itemValue="WP4" itemLabel="WP4 - Square²" /> | ||||
|             	<f:selectItem itemValue="WP5" itemLabel="WP5 - SHIP-Datenbereitstellung" /> | ||||
|             </b:selectOneMenu> | ||||
|           </b:panelGrid> | ||||
|           <b:buttonGroup> | ||||
|             <b:commandButton action="#{doneControl.toList}" immediate="true" value="Abbrechen" /> | ||||
| @@ -67,6 +74,7 @@ | ||||
| 												$("[id='formular:projectInner']").attr("size", 25); | ||||
| 												$("[id='formular:moduleInner']").attr("size", 25); | ||||
| 												$("[id='formular:activityInner']").attr("size", 25); | ||||
| 												$("[id='formular:wpInner']").attr("size", 25); | ||||
| 											}); | ||||
| 										</script> | ||||
|         </b:form> | ||||
|   | ||||
| @@ -41,10 +41,11 @@ | ||||
|               </ui:repeat> | ||||
|             </b:buttonGroup> | ||||
|           </h:panelGrid> | ||||
|           <b:panelGrid colSpans="4,4,4" size="xs"> | ||||
|           <b:panelGrid colSpans="3,3,3,3" size="xs"> | ||||
|             <h:outputText value="Projekt (#{doneModel.bean.projectName})" /> | ||||
|             <h:outputText value="Modul (#{doneModel.bean.moduleName})" /> | ||||
|             <h:outputText value="Tätigkeit (#{doneModel.bean.jobName})" /> | ||||
|             <h:outputText value="euCanSHare WP" /> | ||||
|             <b:selectOneMenu id="project" value="#{doneModel.bean.project}"> | ||||
|               <f:selectItem itemValue="" itemLabel="--- bitte wählen ---" /> | ||||
|               <f:selectItems value="#{doneModel.projects}" var="i" itemValue="#{i}" itemLabel="#{i.name}" /> | ||||
| @@ -57,6 +58,12 @@ | ||||
|               <f:selectItem itemValue="" itemLabel="--- bitte wählen ---" /> | ||||
|               <f:selectItems value="#{doneModel.activities}" var="i" itemValue="#{i}" itemLabel="#{i.name}" /> | ||||
|             </b:selectOneMenu> | ||||
|              <b:selectOneMenu id="wp" value="#{doneModel.bean.wp}"> | ||||
|             	<f:selectItem itemValue="" itemLabel="---" /> | ||||
|             	<f:selectItem itemValue="WP2" itemLabel="WP2 - Opal/Mica/..." /> | ||||
|             	<f:selectItem itemValue="WP4" itemLabel="WP4 - Square²" /> | ||||
|             	<f:selectItem itemValue="WP5" itemLabel="WP5 - SHIP-Datenbereitstellung" /> | ||||
|             </b:selectOneMenu> | ||||
|           </b:panelGrid> | ||||
|           <b:buttonGroup> | ||||
|             <b:commandButton action="#{doneControl.toList}" immediate="true" value="Abbrechen" /> | ||||
| @@ -67,6 +74,7 @@ | ||||
| 												$("[id='formular:projectInner']").attr("size", 25); | ||||
| 												$("[id='formular:moduleInner']").attr("size", 25); | ||||
| 												$("[id='formular:activityInner']").attr("size", 25); | ||||
| 												$("[id='formular:wpInner']").attr("size", 25); | ||||
| 											}); | ||||
| 										</script> | ||||
|         </b:form> | ||||
|   | ||||
| @@ -24,7 +24,7 @@ | ||||
|                   <b:commandButton action="#{doneControl.toDelete(b)}" value="Entfernen" look="danger" iconAwesome="trash" /> | ||||
|                 </b:dataTableColumn> | ||||
|                 <b:dataTableColumn label="" value="#{b.timeSummary}" contentStyleClass="doneoverviewtext" style="width: 128px !important" orderable="false" /> | ||||
|                 <b:dataTableColumn label="" value="#{b.projectName}" contentStyleClass="doneoverviewtextemph" style="width: 128px !important" orderable="false" /> | ||||
|                 <b:dataTableColumn label="" value="#{b.projectNameWithWP}" contentStyleClass="doneoverviewtextemph" style="width: 160px !important" orderable="false" /> | ||||
|                 <b:dataTableColumn label="" value="#{b.timeDiff}" contentStyleClass="doneoverviewtextemph" style="width: 64px !important" orderable="false" /> | ||||
|                 <b:dataTableColumn label="" style="width: 100px !important" orderable="false"> | ||||
|                   <b:commandButton action="#{doneControl.toEdit(b)}" value="Editieren" look="warning" iconAwesome="pencil" /> | ||||
| @@ -74,9 +74,12 @@ | ||||
|               <b:dataTable value="#{doneModel.allJobs}" var="col" border="false" info="false" paginated="false" | ||||
|                 searching="false"> | ||||
|                 <b:dataTableColumn label="" value="#{col.projectName}" contentStyle="font-size: 120%" orderable="false" /> | ||||
|                 <b:dataTableColumn label="" orderable="false"> | ||||
|                 	<b:badge value="#{col.wp}" styleClass="#{col.wp}" /> | ||||
|                 </b:dataTableColumn> | ||||
|                 <b:dataTableColumn label="" value="#{col.moduleName}" contentStyle="font-size: 120%" orderable="false" /> | ||||
|                 <b:dataTableColumn label="" value="#{col.jobName}" contentStyle="font-size: 120%" orderable="false" /> | ||||
|                 <b:dataTableColumn label="" value="#{col.duration}" contentStyle="font-size: 120%" orderable="false" /> | ||||
|                 <b:dataTableColumn label="" value="#{col.duration} = #{col.durationHours} h" contentStyle="font-size: 120%" orderable="false" /> | ||||
|               </b:dataTable> | ||||
|             </b:tab> | ||||
|             <b:tab title="Anhang"> | ||||
|   | ||||
| @@ -28,4 +28,20 @@ | ||||
|  | ||||
| .dangerWell { | ||||
| 	background-image: linear-gradient(to bottom, #eacaca 0%, #fff7f7 100%) !important; | ||||
| } | ||||
| } | ||||
|  | ||||
| .WP2 { | ||||
| 	color: black !important; | ||||
| 	background-color: #ffe169 !important; | ||||
| } | ||||
|  | ||||
| .WP4 { | ||||
| 	color: white !important; | ||||
| 	background-color: #69c3ff !important; | ||||
| } | ||||
|  | ||||
| .WP5 { | ||||
| 	color: black !important; | ||||
| 	background-color: #e396ff !important; | ||||
| } | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user