Gestita data consegna produzione = null
This commit is contained in:
@@ -1476,48 +1476,51 @@ public class GeneraOrdLav {
|
||||
activityID = (String) datiOrdL.get("activity_id");
|
||||
}
|
||||
|
||||
Integer ggDiff = Math.toIntExact(UtilityLocalDate.daysAfterDate(dataInizProdOld, dataInizNew));
|
||||
if (ggDiff != 0) {
|
||||
sql = "SELECT * FROM dtb_ordr";
|
||||
sql = UtilityDB.addwhereCond(sql, ordT.getPkWhereCond(), true);
|
||||
List<DtbOrdr> dtbOrdrL = UtilityDB.executeSimpleQueryDTO(conn, sql, DtbOrdr.class);
|
||||
|
||||
if (dtbOrdrL != null && !dtbOrdrL.isEmpty()) {
|
||||
dtbOrdrL.stream().forEach(x -> {
|
||||
x.setDataCons(UtilityDate.dateAdd(x.getDataCons(), ggDiff));
|
||||
if (dataInizProdOld != null && dataInizNew != null && dataInizProdOld != EmsRestConstants.LOCAL_DATE_NULL && dataInizNew != EmsRestConstants.LOCAL_DATE_NULL){
|
||||
Integer ggDiff = Math.toIntExact(UtilityLocalDate.daysAfterDate(dataInizProdOld, dataInizNew));
|
||||
if (ggDiff != 0) {
|
||||
sql = "SELECT * FROM dtb_ordr";
|
||||
sql = UtilityDB.addwhereCond(sql, ordT.getPkWhereCond(), true);
|
||||
List<DtbOrdr> dtbOrdrL = UtilityDB.executeSimpleQueryDTO(conn, sql, DtbOrdr.class);
|
||||
|
||||
if (dtbOrdrL != null && !dtbOrdrL.isEmpty()) {
|
||||
dtbOrdrL.stream().forEach(x -> {
|
||||
x.setDataCons(UtilityDate.dateAdd(x.getDataCons(), ggDiff));
|
||||
x.setOperation(OperationType.UPDATE);
|
||||
});
|
||||
|
||||
ordT.setDtbOrdr(dtbOrdrL);
|
||||
}
|
||||
|
||||
sql = "SELECT * FROM dtb_ord_steps";
|
||||
sql = UtilityDB.addwhereCond(sql, ordT.getPkWhereCond(), true);
|
||||
List<DtbOrdSteps> dtbOrdSteps = UtilityDB.executeSimpleQueryDTO(conn, sql, DtbOrdSteps.class);
|
||||
|
||||
dtbOrdSteps.stream().forEach(x -> {
|
||||
x.setDataIniz(x.getDataIniz() != null ? UtilityDate.dateAdd(x.getDataIniz(), ggDiff) : null);
|
||||
x.setDataFine(x.getDataFine() != null ? UtilityDate.dateAdd(x.getDataFine(), ggDiff) : null);
|
||||
x.setOperation(OperationType.UPDATE);
|
||||
});
|
||||
|
||||
ordT.setDtbOrdr(dtbOrdrL);
|
||||
}
|
||||
ordT.setDtbOrdSteps(dtbOrdSteps);
|
||||
|
||||
sql = "SELECT * FROM dtb_ord_steps";
|
||||
sql = UtilityDB.addwhereCond(sql, ordT.getPkWhereCond(), true);
|
||||
List<DtbOrdSteps> dtbOrdSteps = UtilityDB.executeSimpleQueryDTO(conn, sql, DtbOrdSteps.class);
|
||||
// FABIO: DA CAPIRE COME VALORIZZATA LE ATTIVITA MODIFICATE
|
||||
if (assegnaAttivita) {
|
||||
sql = "SELECT stb_activity.* " +
|
||||
" FROM stb_activity " +
|
||||
" where (activity_id = " + UtilityDB.valueToString(activityID) + " or " +
|
||||
" parent_activity_id = " + UtilityDB.valueToString(activityID) + ")";
|
||||
List<StbActivity> stbActivity = UtilityDB.executeSimpleQueryDTO(conn, sql, StbActivity.class);
|
||||
|
||||
dtbOrdSteps.stream().forEach(x -> {
|
||||
x.setDataIniz(x.getDataIniz() != null ? UtilityDate.dateAdd(x.getDataIniz(), ggDiff) : null);
|
||||
x.setDataFine(x.getDataFine() != null ? UtilityDate.dateAdd(x.getDataFine(), ggDiff) : null);
|
||||
x.setOperation(OperationType.UPDATE);
|
||||
});
|
||||
stbActivity.stream().forEach(x -> {
|
||||
x.setEstimatedTime(x.getEstimatedTime().plusDays(ggDiff));
|
||||
x.setEstimatedEndtime(x.getEstimatedEndtime().plusDays(ggDiff));
|
||||
x.setOperation(OperationType.INSERT_OR_UPDATE);
|
||||
});
|
||||
|
||||
ordT.setDtbOrdSteps(dtbOrdSteps);
|
||||
|
||||
// FABIO: DA CAPIRE COME VALORIZZATA LE ATTIVITA MODIFICATE
|
||||
if (assegnaAttivita) {
|
||||
sql = "SELECT stb_activity.* " +
|
||||
" FROM stb_activity " +
|
||||
" where (activity_id = " + UtilityDB.valueToString(activityID) + " or " +
|
||||
" parent_activity_id = " + UtilityDB.valueToString(activityID) + ")";
|
||||
List<StbActivity> stbActivity = UtilityDB.executeSimpleQueryDTO(conn, sql, StbActivity.class);
|
||||
|
||||
stbActivity.stream().forEach(x -> {
|
||||
x.setEstimatedTime(x.getEstimatedTime().plusDays(ggDiff));
|
||||
x.setEstimatedEndtime(x.getEstimatedEndtime().plusDays(ggDiff));
|
||||
x.setOperation(OperationType.INSERT_OR_UPDATE);
|
||||
});
|
||||
|
||||
row.setStbActivityList(stbActivity);
|
||||
row.setStbActivityList(stbActivity);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user