Bag fixing.
This commit is contained in:
psemenkov 2023-08-17 17:10:33 +03:00
parent 1abbc5f734
commit 25c2be5c52
3 changed files with 12 additions and 12 deletions

View file

@ -56,8 +56,8 @@ public class PlannerAllTodayMaker {
});
listOfPlannerAllToday.stream()
.filter(plannerAllToday -> null == getFirstObjectByFieldValues(Map.of(
"parentId = %s", plannerAllToday.getParentId(),
"clearingDate = %s", plannerAllToday.getClearingDate())))
"parentId", plannerAllToday.getParentId(),
"clearingDate", plannerAllToday.getClearingDate())))
.forEach(plannerAllToday -> {
plannerAllToday.setId(hazelcastInstance.getIdGenerator(MAP_SEQUENCE_NAME).newId());
plannerAllTodayMap.put(plannerAllToday.getId(), plannerAllToday);

View file

@ -154,8 +154,8 @@ public class PlannerService extends QueueConsumer implements InitializingBean {
Planner planner = plannerMap.getSingleObjectByID(req.getId());
plannerMap.delete(planner);
Collection<PlannerAllToday> values = plannerAllTodayMap.getCollectionObjectsByFieldValues(Map.of(
"parentId = %s", planner.getId(),
"clearingDate = %s", planner.getClearingDate() != null ? planner.getClearingDate() : LocalDate.now()));
"parentId", planner.getId(),
"clearingDate", planner.getClearingDate() != null ? planner.getClearingDate() : LocalDate.now()));
values.forEach(p -> {
plannerAllTodayMap.delete(p);
addToPlannerQueue(TaskManager.Process.delete, p);
@ -168,8 +168,8 @@ public class PlannerService extends QueueConsumer implements InitializingBean {
if (planner.getTaskStatus().equalsIgnoreCase(Status.Active.getKey())) {
PlannerAllToday plannerAllToday = PlannerAllTodayBuilder.builder().append(planner).build();
PlannerAllToday oldPlannerAllToday = plannerAllTodayMap.getFirstObjectByFieldValues(Map.of(
"parentId = %s", planner.getId(),
"clearingDate = %s", planner.getClearingDate()));
"parentId", planner.getId(),
"clearingDate", planner.getClearingDate()));
if (oldPlannerAllToday != null) {
plannerAllToday.setId(oldPlannerAllToday.getId());
plannerAllTodayMap.insert(plannerAllToday);
@ -183,8 +183,8 @@ public class PlannerService extends QueueConsumer implements InitializingBean {
if (planner.getTaskStatus().equalsIgnoreCase(Status.Cancel.getKey()) || planner.getTaskStatus().equalsIgnoreCase(Status.Blocked.getKey())) {
Collection<PlannerAllToday> values = plannerAllTodayMap.getCollectionObjectsByFieldValues(Map.of(
"parentId = %s", planner.getId(),
"clearingDate = %s", planner.getClearingDate()));
"parentId", planner.getId(),
"clearingDate", planner.getClearingDate()));
values.forEach(plannerAllToday -> {
plannerAllTodayMap.delete(plannerAllToday);
addToPlannerQueue(TaskManager.Process.delete, plannerAllToday);

View file

@ -139,8 +139,8 @@ public class PlannerTemplateService extends QueueConsumer implements Initializin
if (todayWorkDay()) {
PlannerAllToday plannerAllToday = PlannerAllTodayBuilder.builder().append(plannerTemplate).build();
PlannerAllToday oldPlannerAllToday = plannerAllTodayMap.getFirstObjectByFieldValues(Map.of(
"parentId = %s", plannerTemplate.getId(),
"clearingDate = %s", LocalDate.now()));
"parentId", plannerTemplate.getId(),
"clearingDate", LocalDate.now()));
if (oldPlannerAllToday != null) {
plannerAllToday.setId(oldPlannerAllToday.getId());
plannerAllTodayMap.insert(plannerAllToday);
@ -167,8 +167,8 @@ public class PlannerTemplateService extends QueueConsumer implements Initializin
if (todayWorkDay()) {
PlannerAllToday plannerAllToday = plannerAllTodayMap.getFirstObjectByFieldValues(Map.of(
"parentId = %s", plannerTemplate.getId(),
"clearingDate = %s", LocalDate.now()));
"parentId", plannerTemplate.getId(),
"clearingDate", LocalDate.now()));
if (plannerAllToday != null) {
plannerAllTodayMap.delete(plannerAllToday);
addToPlannerQueue(TaskManager.Process.delete, plannerAllToday);