[CARELLI]

- gestione salvataggio activity_Types per calendario pv
This commit is contained in:
2025-05-16 18:00:43 +02:00
parent 14590bbe4c
commit bb52efea76
4 changed files with 49 additions and 0 deletions

View File

@@ -0,0 +1,24 @@
package it.integry.ems.migration.model;
import it.integry.ems.migration._base.BaseMigration;
import it.integry.ems.migration._base.MigrationModelInterface;
public class Migration_20250516175157 extends BaseMigration implements MigrationModelInterface {
@Override
public void up() throws Exception {
if (isHistoryDB())
return;
executeStatement("ALTER TABLE stb_activity_plan ADD flag_tipologia varchar DEFAULT 'A' NOT NULL");
executeStatement("alter table dbo.stb_activity_plan\n" +
" add constraint fk__stb_activity_plan_stb_activity_type\n" +
" foreign key (activity_type_id, flag_tipologia) references dbo.stb_activity_type");
}
@Override
public void down() throws Exception {
}
}

View File

@@ -31,6 +31,9 @@ public class StbActivityPlan extends EntityBase {
@SqlField("activity_type_id")
private String activityTypeId;
@SqlField("flag_tipologia")
private String flagTipologia;
@SqlField("first_occurrence")
private LocalDate firstOccurrence;
@@ -208,6 +211,15 @@ public class StbActivityPlan extends EntityBase {
return this;
}
public String getFlagTipologia() {
return flagTipologia;
}
public StbActivityPlan setFlagTipologia(String flagTipologia) {
this.flagTipologia = flagTipologia;
return this;
}
@Override
protected void deleteChilds() throws Exception {
String whereCond = getPkWhereCond();

View File

@@ -53,6 +53,9 @@ public class StbActivityType extends EntityBase {
@SqlField(value = "flag_generate_mov", maxLength = 1, nullable = false, defaultObjectValue = "S")
private String flagGenerateMov;
@SqlField("flag_view_calendar")
private boolean flagViewCalendar;
@EntityChild
private List<StbActivityTyper> stbActivityTyper = new ArrayList<>();
@@ -159,6 +162,15 @@ public class StbActivityType extends EntityBase {
this.srlActivityTypeUser = srlActivityTypeUser;
}
public boolean isFlagViewCalendar() {
return flagViewCalendar;
}
public StbActivityType setFlagViewCalendar(boolean flagViewCalendar) {
this.flagViewCalendar = flagViewCalendar;
return this;
}
@Override
protected void insertChilds() throws Exception {
for (SrlActivityTypeUser srlActivityTypeUser : getSrlActivityTypeUser()) {

View File

@@ -1769,6 +1769,7 @@ public class ActivityService {
plan
.setId(dto.getId())
.setActivityTypeId(dto.getActivityTypeId())
.setFlagTipologia("A")
.setFirstOccurrence(dto.getFirstOccurrence())
.setLastOccurrence(dto.getLastOccurrence())
.setStartTime(dto.getStartTime())