Finish Hotfix-100
All checks were successful
IntegryManagementSystem_Multi/pipeline/head This commit looks good
All checks were successful
IntegryManagementSystem_Multi/pipeline/head This commit looks good
This commit is contained in:
@@ -626,6 +626,38 @@ public class AccountingRules extends QueryRules {
|
|||||||
impAvere = ctbScad.getImpAvere().divide(cambioScad, 5, RoundingMode.HALF_UP);
|
impAvere = ctbScad.getImpAvere().divide(cambioScad, 5, RoundingMode.HALF_UP);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
boolean existPartita = false;
|
||||||
|
if (riperta) {
|
||||||
|
sql =
|
||||||
|
Query.format(
|
||||||
|
"select CAST(count(*) As bit)\n" +
|
||||||
|
"from crl_scad_parr\n" +
|
||||||
|
"where num_cmov = %s\n" +
|
||||||
|
" and cod_anag = %s AND " +
|
||||||
|
"tipo_anag = %s AND " +
|
||||||
|
"anno_part = %s AND " +
|
||||||
|
"ser_doc = %s AND " +
|
||||||
|
"num_doc = %s AND " +
|
||||||
|
"id_riga_scad = %s ",
|
||||||
|
ctbMovr.getNumCmov(),
|
||||||
|
ctbScad.getCodAnag(),
|
||||||
|
ctbScad.getTipoAnag(),
|
||||||
|
ctbScad.getAnnoPart(),
|
||||||
|
ctbScad.getSerDoc(),
|
||||||
|
ctbScad.getNumDoc(),
|
||||||
|
ctbScad.getIdRiga()
|
||||||
|
);
|
||||||
|
|
||||||
|
existPartita =
|
||||||
|
UtilityDB.executeSimpleQueryOnlyFirstRowFirstColumn(conn,
|
||||||
|
sql);
|
||||||
|
}
|
||||||
|
|
||||||
|
OperationType operationType = OperationType.INSERT_OR_UPDATE;
|
||||||
|
if (riperta && existPartita){
|
||||||
|
operationType = OperationType.DELETE;
|
||||||
|
}
|
||||||
|
|
||||||
ctbParr =
|
ctbParr =
|
||||||
new CtbParr()
|
new CtbParr()
|
||||||
.setCodCcon(ctbMovr.getCodCcon())
|
.setCodCcon(ctbMovr.getCodCcon())
|
||||||
@@ -643,7 +675,7 @@ public class AccountingRules extends QueryRules {
|
|||||||
.setTipoPartita(tipoPartita)
|
.setTipoPartita(tipoPartita)
|
||||||
.setChiudiScad(ctbMovr.getChiudiScad())
|
.setChiudiScad(ctbMovr.getChiudiScad())
|
||||||
.setCambioDiviScad(cambioScad);
|
.setCambioDiviScad(cambioScad);
|
||||||
ctbParr.setOperation(OperationType.INSERT_OR_UPDATE);
|
ctbParr.setOperation(operationType);
|
||||||
}
|
}
|
||||||
|
|
||||||
elencoPartite.add(ctbParr);
|
elencoPartite.add(ctbParr);
|
||||||
@@ -669,7 +701,10 @@ public class AccountingRules extends QueryRules {
|
|||||||
crlScadParr.setOperation(OperationType.INSERT);
|
crlScadParr.setOperation(OperationType.INSERT);
|
||||||
else {
|
else {
|
||||||
crlScadParr.setId(id);
|
crlScadParr.setId(id);
|
||||||
crlScadParr.setOperation(OperationType.UPDATE);
|
if ( ctbScad.getOperation() == OperationType.DELETE)
|
||||||
|
crlScadParr.setOperation(OperationType.DELETE);
|
||||||
|
else
|
||||||
|
crlScadParr.setOperation(OperationType.UPDATE);
|
||||||
}
|
}
|
||||||
ctbScad
|
ctbScad
|
||||||
.setIdRigaMov(ctbMovr.getIdRiga())
|
.setIdRigaMov(ctbMovr.getIdRiga())
|
||||||
@@ -681,11 +716,15 @@ public class AccountingRules extends QueryRules {
|
|||||||
} else {
|
} else {
|
||||||
sql =
|
sql =
|
||||||
Query.format(
|
Query.format(
|
||||||
"SELECT cast(case when count(*) > 1 THEN 1 ELSE 0 eND as bit) " +
|
"SELECT cast(count(*) as bit) " +
|
||||||
" FROM ctb_parr " +
|
" FROM ctb_parr " +
|
||||||
" WHERE num_cmov = %s AND " +
|
" WHERE cod_anag = %s AND " +
|
||||||
|
"tipo_anag = %s AND " +
|
||||||
|
"anno_part = %s AND " +
|
||||||
|
"ser_doc = %s AND " +
|
||||||
|
"num_doc = %s AND " +
|
||||||
"id_riga = %s ",
|
"id_riga = %s ",
|
||||||
ctbMovr.getNumCmov(), ctbMovr.getIdRiga());
|
ctbMovr.getCodAnag(), ctbMovr.getTipoAnag(), ctbMovr.getAnnoPart(), ctbMovr.getSerDoc(), ctbMovr.getNumDoc(), ctbMovr.getIdRiga());
|
||||||
|
|
||||||
boolean existRow = UtilityDB.executeSimpleQueryOnlyFirstRowFirstColumn(conn, sql);
|
boolean existRow = UtilityDB.executeSimpleQueryOnlyFirstRowFirstColumn(conn, sql);
|
||||||
|
|
||||||
|
|||||||
@@ -27,11 +27,10 @@ public class MtbDepoArea extends EntityBase {
|
|||||||
@SqlField(value = "descrizione", maxLength = 255)
|
@SqlField(value = "descrizione", maxLength = 255)
|
||||||
private String descrizione;
|
private String descrizione;
|
||||||
|
|
||||||
|
@PK
|
||||||
@SqlField(value = "cod_area", maxLength = 15)
|
@SqlField(value = "cod_area", maxLength = 15)
|
||||||
private String codArea;
|
private String codArea;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public MtbDepoArea() {
|
public MtbDepoArea() {
|
||||||
super(logger);
|
super(logger);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,6 +33,7 @@ import org.springframework.stereotype.Service;
|
|||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
import javax.ejb.Local;
|
import javax.ejb.Local;
|
||||||
|
import java.math.BigDecimal;
|
||||||
import java.sql.PreparedStatement;
|
import java.sql.PreparedStatement;
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
import java.time.Instant;
|
import java.time.Instant;
|
||||||
@@ -1453,6 +1454,15 @@ public class ActivityService {
|
|||||||
StbActivity stbActivity = new StbActivity();
|
StbActivity stbActivity = new StbActivity();
|
||||||
stbActivity.setOperation(OperationType.UPDATE);
|
stbActivity.setOperation(OperationType.UPDATE);
|
||||||
|
|
||||||
|
if (activity.getEffectiveEndtime() == null)
|
||||||
|
activity.setEffectiveEndtime(UtilityLocalDate.getNowTime());
|
||||||
|
|
||||||
|
if (activity.getEffectiveTime() == null) {
|
||||||
|
BigDecimal oreLav = activity.getOreLav().multiply(new BigDecimal(100))
|
||||||
|
.divide(new BigDecimal(60));
|
||||||
|
activity.setEffectiveTime(activity.getEffectiveEndtime().minusMinutes(oreLav.intValue()));
|
||||||
|
}
|
||||||
|
|
||||||
stbActivity.setActivityId(activity.getActivityId())
|
stbActivity.setActivityId(activity.getActivityId())
|
||||||
.setActivityDescription(activity.getActivityDescription())
|
.setActivityDescription(activity.getActivityDescription())
|
||||||
.setNote(activity.getNote())
|
.setNote(activity.getNote())
|
||||||
|
|||||||
@@ -21,11 +21,12 @@ import java.util.List;
|
|||||||
public class MovimentiContabiliService {
|
public class MovimentiContabiliService {
|
||||||
@Autowired
|
@Autowired
|
||||||
private EntityProcessor entityProcessor;
|
private EntityProcessor entityProcessor;
|
||||||
|
|
||||||
public CtbMovt save(MultiDBTransactionManager multiDBTransactionManager, CtbMovt ctbMovt) throws Exception {
|
public CtbMovt save(MultiDBTransactionManager multiDBTransactionManager, CtbMovt ctbMovt) throws Exception {
|
||||||
List<EntityBase> entitiesToSave = new ArrayList<>();
|
List<EntityBase> entitiesToSave = new ArrayList<>();
|
||||||
|
|
||||||
if (ctbMovt.getNumCmov() != null && ctbMovt.getOperation() != OperationType.DELETE) {
|
if (ctbMovt.getNumCmov() != null && ctbMovt.getOperation() != OperationType.DELETE) {
|
||||||
if(ctbMovt.getCodAnag()!= null) {
|
if (ctbMovt.getCodAnag() != null) {
|
||||||
String sql =
|
String sql =
|
||||||
Query.format("SELECT cod_anag FROM ctb_movt WHERE num_cmov = %s", ctbMovt.getNumCmov());
|
Query.format("SELECT cod_anag FROM ctb_movt WHERE num_cmov = %s", ctbMovt.getNumCmov());
|
||||||
|
|
||||||
@@ -63,7 +64,7 @@ public class MovimentiContabiliService {
|
|||||||
List<EntityBase> entityRet = entityProcessor.processEntityList(entitiesToSave, multiDBTransactionManager, true);
|
List<EntityBase> entityRet = entityProcessor.processEntityList(entitiesToSave, multiDBTransactionManager, true);
|
||||||
UtilityEntity.throwEntitiesException(entityRet);
|
UtilityEntity.throwEntitiesException(entityRet);
|
||||||
|
|
||||||
CtbMovt ctbMovtRet = entityRet.stream().filter(x->x instanceof CtbMovt).map(x->(CtbMovt)x).findFirst().orElse(null);
|
CtbMovt ctbMovtRet = entityRet.stream().filter(x -> x instanceof CtbMovt).map(x -> (CtbMovt) x).findFirst().orElse(null);
|
||||||
return ctbMovtRet;
|
return ctbMovtRet;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -89,11 +90,13 @@ public class MovimentiContabiliService {
|
|||||||
|
|
||||||
List<CtbMovt> ctbMovts = UtilityDB.executeSimpleQueryDTO(multiDBTransactionManager.getPrimaryConnection(), sql, CtbMovt.class);
|
List<CtbMovt> ctbMovts = UtilityDB.executeSimpleQueryDTO(multiDBTransactionManager.getPrimaryConnection(), sql, CtbMovt.class);
|
||||||
|
|
||||||
if ( ctbMovts == null || ctbMovts.isEmpty()) {
|
if (ctbMovts == null || ctbMovts.isEmpty()) {
|
||||||
throw new Exception("Impossibile nessun movimento da cancellare.");
|
throw new Exception("Impossibile nessun movimento da cancellare.");
|
||||||
}
|
}
|
||||||
|
|
||||||
ctbMovts.stream().forEach(x->{x.setOperation(OperationType.DELETE);});
|
ctbMovts.stream().forEach(x -> {
|
||||||
|
x.setOperation(OperationType.DELETE);
|
||||||
|
});
|
||||||
|
|
||||||
List<EntityBase> entityBaseList = entityProcessor.processEntityList(ctbMovts, multiDBTransactionManager, false);
|
List<EntityBase> entityBaseList = entityProcessor.processEntityList(ctbMovts, multiDBTransactionManager, false);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user