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);
|
||||
}
|
||||
|
||||
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 =
|
||||
new CtbParr()
|
||||
.setCodCcon(ctbMovr.getCodCcon())
|
||||
@@ -643,7 +675,7 @@ public class AccountingRules extends QueryRules {
|
||||
.setTipoPartita(tipoPartita)
|
||||
.setChiudiScad(ctbMovr.getChiudiScad())
|
||||
.setCambioDiviScad(cambioScad);
|
||||
ctbParr.setOperation(OperationType.INSERT_OR_UPDATE);
|
||||
ctbParr.setOperation(operationType);
|
||||
}
|
||||
|
||||
elencoPartite.add(ctbParr);
|
||||
@@ -669,7 +701,10 @@ public class AccountingRules extends QueryRules {
|
||||
crlScadParr.setOperation(OperationType.INSERT);
|
||||
else {
|
||||
crlScadParr.setId(id);
|
||||
crlScadParr.setOperation(OperationType.UPDATE);
|
||||
if ( ctbScad.getOperation() == OperationType.DELETE)
|
||||
crlScadParr.setOperation(OperationType.DELETE);
|
||||
else
|
||||
crlScadParr.setOperation(OperationType.UPDATE);
|
||||
}
|
||||
ctbScad
|
||||
.setIdRigaMov(ctbMovr.getIdRiga())
|
||||
@@ -681,11 +716,15 @@ public class AccountingRules extends QueryRules {
|
||||
} else {
|
||||
sql =
|
||||
Query.format(
|
||||
"SELECT cast(case when count(*) > 1 THEN 1 ELSE 0 eND as bit) " +
|
||||
" FROM ctb_parr " +
|
||||
" WHERE num_cmov = %s AND " +
|
||||
"SELECT cast(count(*) as bit) " +
|
||||
" FROM ctb_parr " +
|
||||
" WHERE cod_anag = %s AND " +
|
||||
"tipo_anag = %s AND " +
|
||||
"anno_part = %s AND " +
|
||||
"ser_doc = %s AND " +
|
||||
"num_doc = %s AND " +
|
||||
"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);
|
||||
|
||||
|
||||
@@ -27,11 +27,10 @@ public class MtbDepoArea extends EntityBase {
|
||||
@SqlField(value = "descrizione", maxLength = 255)
|
||||
private String descrizione;
|
||||
|
||||
@PK
|
||||
@SqlField(value = "cod_area", maxLength = 15)
|
||||
private String codArea;
|
||||
|
||||
|
||||
|
||||
public MtbDepoArea() {
|
||||
super(logger);
|
||||
}
|
||||
|
||||
@@ -33,6 +33,7 @@ import org.springframework.stereotype.Service;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.ejb.Local;
|
||||
import java.math.BigDecimal;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.time.Instant;
|
||||
@@ -1453,6 +1454,15 @@ public class ActivityService {
|
||||
StbActivity stbActivity = new StbActivity();
|
||||
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())
|
||||
.setActivityDescription(activity.getActivityDescription())
|
||||
.setNote(activity.getNote())
|
||||
|
||||
@@ -21,11 +21,12 @@ import java.util.List;
|
||||
public class MovimentiContabiliService {
|
||||
@Autowired
|
||||
private EntityProcessor entityProcessor;
|
||||
|
||||
public CtbMovt save(MultiDBTransactionManager multiDBTransactionManager, CtbMovt ctbMovt) throws Exception {
|
||||
List<EntityBase> entitiesToSave = new ArrayList<>();
|
||||
|
||||
if (ctbMovt.getNumCmov() != null && ctbMovt.getOperation() != OperationType.DELETE) {
|
||||
if(ctbMovt.getCodAnag()!= null) {
|
||||
if (ctbMovt.getCodAnag() != null) {
|
||||
String sql =
|
||||
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);
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -89,11 +90,13 @@ public class MovimentiContabiliService {
|
||||
|
||||
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.");
|
||||
}
|
||||
|
||||
ctbMovts.stream().forEach(x->{x.setOperation(OperationType.DELETE);});
|
||||
ctbMovts.stream().forEach(x -> {
|
||||
x.setOperation(OperationType.DELETE);
|
||||
});
|
||||
|
||||
List<EntityBase> entityBaseList = entityProcessor.processEntityList(ctbMovts, multiDBTransactionManager, false);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user