use start time from now rounded for favorites, too
This commit is contained in:
@ -7,7 +7,7 @@ plugins {
|
|||||||
apply plugin: 'io.spring.dependency-management'
|
apply plugin: 'io.spring.dependency-management'
|
||||||
|
|
||||||
group = 'de.jottyfan'
|
group = 'de.jottyfan'
|
||||||
version = '1.4.1'
|
version = '1.4.2'
|
||||||
|
|
||||||
description = """timetrack"""
|
description = """timetrack"""
|
||||||
|
|
||||||
|
@ -32,6 +32,7 @@ import org.jooq.SelectConditionStep;
|
|||||||
import org.jooq.SelectLimitPercentStep;
|
import org.jooq.SelectLimitPercentStep;
|
||||||
import org.jooq.UpdateConditionStep;
|
import org.jooq.UpdateConditionStep;
|
||||||
import org.jooq.exception.DataAccessException;
|
import org.jooq.exception.DataAccessException;
|
||||||
|
import org.jooq.impl.DSL;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Repository;
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
@ -524,12 +525,12 @@ public class DoneGateway {
|
|||||||
*
|
*
|
||||||
* @param fkFavorite the id of the favorite
|
* @param fkFavorite the id of the favorite
|
||||||
*/
|
*/
|
||||||
public void useFav(Integer fkFavorite) {
|
public void useFav(Integer fkFavorite, LocalDateTime startTime) {
|
||||||
InsertOnDuplicateStep<TDoneRecord> sql = getJooq()
|
InsertOnDuplicateStep<TDoneRecord> sql = getJooq()
|
||||||
// @formatter:off
|
// @formatter:off
|
||||||
.insertInto(T_DONE, T_DONE.FK_LOGIN, T_DONE.FK_PROJECT, T_DONE.FK_MODULE, T_DONE.FK_JOB, T_DONE.FK_BILLING)
|
.insertInto(T_DONE, T_DONE.FK_LOGIN, T_DONE.FK_PROJECT, T_DONE.FK_MODULE, T_DONE.FK_JOB, T_DONE.FK_BILLING, T_DONE.TIME_FROM)
|
||||||
.select(getJooq()
|
.select(getJooq()
|
||||||
.select(T_FAVORITE.FK_LOGIN, T_FAVORITE.FK_PROJECT, T_FAVORITE.FK_MODULE, T_FAVORITE.FK_JOB, T_FAVORITE.FK_BILLING)
|
.select(T_FAVORITE.FK_LOGIN, T_FAVORITE.FK_PROJECT, T_FAVORITE.FK_MODULE, T_FAVORITE.FK_JOB, T_FAVORITE.FK_BILLING, DSL.val(startTime))
|
||||||
.from(T_FAVORITE)
|
.from(T_FAVORITE)
|
||||||
.where(T_FAVORITE.PK_FAVORITE.eq(fkFavorite)));
|
.where(T_FAVORITE.PK_FAVORITE.eq(fkFavorite)));
|
||||||
// @formatter:on
|
// @formatter:on
|
||||||
|
@ -222,7 +222,7 @@ public class DoneService {
|
|||||||
|
|
||||||
public void usefavorite(Integer fkFavorite) {
|
public void usefavorite(Integer fkFavorite) {
|
||||||
try {
|
try {
|
||||||
new DoneGateway(dsl).useFav(fkFavorite);
|
new DoneGateway(dsl).useFav(fkFavorite, timeService.roundTime(LocalDateTime.now(), INTERVAL));
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user