fixes bug#AL-1296

master
wallace.henrique 2023-01-27 18:07:36 -03:00
parent 0d9a4d5c47
commit dd0938d151
6 changed files with 16 additions and 50 deletions

View File

@ -26,7 +26,6 @@ import javax.persistence.TemporalType;
import javax.persistence.Transient;
import org.apache.commons.lang.BooleanUtils;
import org.hibernate.Hibernate;
import org.hibernate.annotations.NotFound;
import org.hibernate.annotations.NotFoundAction;

View File

@ -20,10 +20,9 @@ import br.com.rjconsultores.auditador.annotations.AuditarClasse;
import br.com.rjconsultores.auditador.annotations.NaoAuditar;
import br.com.rjconsultores.auditador.interfaces.Auditavel;
@AuditarClasse(nome = "FechamentoParamptovta", tela = "Alteração de Ponto de Venda/Fechamento Conta Corrente")
@Entity
@Table(name = "FECHAMENTO_PARAMPTOVTA")
public class FechamentoParamptovta implements Serializable, Auditavel<FechamentoParamptovta> {
public class FechamentoParamptovta implements Serializable {
private static final long serialVersionUID = 1L;
@ -36,9 +35,7 @@ public class FechamentoParamptovta implements Serializable, Auditavel<Fechamento
private Boolean activo;
private Integer diasemtransito;
private String tipopagamento;
@Transient
@NaoAuditar
private FechamentoParamptovta fechamentoParamptovtaClone;
public FechamentoParamptovta() {
}
@ -154,21 +151,5 @@ public class FechamentoParamptovta implements Serializable, Auditavel<Fechamento
public void setTipopagamento(String tipopagamento) {
this.tipopagamento = tipopagamento;
}
public void clonar() throws CloneNotSupportedException {
fechamentoParamptovtaClone = new FechamentoParamptovta();
fechamentoParamptovtaClone = (FechamentoParamptovta) this.clone();
}
@Transient
public FechamentoParamptovta getCloneObject() throws CloneNotSupportedException {
return fechamentoParamptovtaClone;
}
@Transient
public String getTextoInclusaoExclusao() {
return String.format("ID [%s]", getFechamentoparamptovtaId());
}
}

View File

@ -160,7 +160,9 @@ public class PtovtaCatInd implements Serializable, Auditavel<PtovtaCatInd> {
@Override
public String getTextoInclusaoExclusao() {
return String.format("ID [%s]", getCategoria().getDesccategoria());
String totalbus = Boolean.TRUE.equals(getIndTotalBus()) ? "Totalbus : Sim" : "Totalbus : Não";
String embarcada = Boolean.TRUE.equals(getIndEmbarcada()) ? "Embarcada : Sim" : "Embarcada : Não";
return String.format("ID [%s]", getCategoria().getDesccategoria()+ "-"+totalbus+ "-"+embarcada);
}

View File

@ -52,7 +52,7 @@ import br.com.rjconsultores.auditador.interfaces.Auditavel;
*/
@Entity
@SequenceGenerator(name = "PUNTO_VENTA_SEQ", sequenceName = "PUNTO_VENTA_SEQ", allocationSize = 1)
@AuditarClasse(nome = "PuntoVenta", tela = "Altera<EFBFBD><EFBFBD>o de Ponto de Venda")
@AuditarClasse(nome = "PuntoVenta", tela = "Alteracao de Ponto de Venda")
@Table(name = "PUNTO_VENTA")
public class PuntoVenta implements Serializable, Auditavel<PuntoVenta> {
@ -101,7 +101,7 @@ public class PuntoVenta implements Serializable, Auditavel<PuntoVenta> {
@JoinColumn(name = "TIPOPTOVTA_ID", referencedColumnName = "TIPOPTOVTA_ID")
@ManyToOne
private TipoPuntoVenta tipoPuntoVenta;
@AuditarLista(auditarEntidades = true, nome = "ReservacionPuntoVenta")
@NaoAuditar
@OneToMany(mappedBy = "puntoVenta")
private List<ReservacionPuntoVenta> reservacionPuntoventaList;
@OneToOne
@ -228,7 +228,7 @@ public class PuntoVenta implements Serializable, Auditavel<PuntoVenta> {
@LazyCollection(LazyCollectionOption.FALSE)
private List<PtoVtaSeguro> ptovtaSeguroList;
@AuditarLista(auditarEntidades = true, nome = "PtovtaCatInd")
@AuditarLista(auditarEntidades = true, nome = "ptovtaCatIndList")
@OneToMany(cascade = CascadeType.ALL, mappedBy = "puntoVenta")
@LazyCollection(LazyCollectionOption.FALSE)
private List<PtovtaCatInd> ptovtaCatIndList;
@ -1322,15 +1322,15 @@ public class PuntoVenta implements Serializable, Auditavel<PuntoVenta> {
puntoVentaClone = new PuntoVenta();
puntoVentaClone = (PuntoVenta) this.clone();
if(this.getReservacionPuntoventaList() != null) {
List<ReservacionPuntoVenta> lsClones = new ArrayList<ReservacionPuntoVenta>();
for (ReservacionPuntoVenta reservacionPuntoVenta : this.getReservacionPuntoventaList()) {
if(BooleanUtils.isTrue(reservacionPuntoVenta.getActivo())) {
reservacionPuntoVenta.clonar();
lsClones.add(reservacionPuntoVenta.getCloneObject());
if(this.getPtovtaCatIndList() != null) {
List<PtovtaCatInd> lsClones = new ArrayList<PtovtaCatInd>();
for (PtovtaCatInd ptovtaCatInd : this.getPtovtaCatIndList()) {
if(BooleanUtils.isTrue(ptovtaCatInd.getActivo())) {
ptovtaCatInd.clonar();
lsClones.add(ptovtaCatInd.getCloneObject());
}
}
puntoVentaClone.setReservacionPuntoventaList(lsClones);
puntoVentaClone.setPtovtaCatIndList(lsClones);
}
}

View File

@ -33,13 +33,7 @@ public class FechamentoParamptovtaServiceImpl implements FechamentoParamptovtaSe
@Override
public FechamentoParamptovta obtenerID(Long id) {
FechamentoParamptovta fechamentoParamptovta = fechamentoParamptovtaDAO.obtenerID(id);
try {
fechamentoParamptovta.clonar();
} catch (Exception e) {
log.error(e.getMessage(), e);
}
return fechamentoParamptovta;
return fechamentoParamptovtaDAO.obtenerID(id);
}
@ -57,11 +51,6 @@ public class FechamentoParamptovtaServiceImpl implements FechamentoParamptovtaSe
public FechamentoParamptovta actualizacion(FechamentoParamptovta entidad) {
entidad.setFecmodif(new Date());
FechamentoParamptovta originalClone = null;
try {
originalClone = entidad.getCloneObject();
} catch (Exception e) {
log.error("",e);
}
fechamentoParamptovtaDAO.actualizacion(entidad);
logAuditoriaService.auditar(originalClone, entidad, entidad.getEmpresa() != null ? entidad.getEmpresa().getEmpresaId() : null);
return entidad;

View File

@ -9,7 +9,6 @@ import org.springframework.transaction.annotation.Transactional;
import com.rjconsultores.ventaboletos.dao.PtovtaCatIndDAO;
import com.rjconsultores.ventaboletos.entidad.PtovtaCatInd;
import com.rjconsultores.ventaboletos.service.LogAuditoriaService;
import com.rjconsultores.ventaboletos.service.PtovtaCatIndService;
import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
@ -18,8 +17,6 @@ public class PtovtaCatIndServiceImpl implements PtovtaCatIndService {
@Autowired
private PtovtaCatIndDAO ptovtaCatIndDAO;
@Autowired
private LogAuditoriaService logAuditoriaService;
@Override
public List<PtovtaCatInd> obtenerTodos() {
@ -56,8 +53,6 @@ public class PtovtaCatIndServiceImpl implements PtovtaCatIndService {
entidad.setFecmodif(Calendar.getInstance().getTime());
entidad.setActivo(Boolean.FALSE);
ptovtaCatIndDAO.actualizacion(entidad);
logAuditoriaService.auditarExclusao(entidad, entidad.getEmpresa() != null ? entidad.getEmpresa().getEmpresaId() : null);
}