WS Receber/Pagar - Novos campos (bug #6181)
Tempo: 1 horas git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Model/trunk/modelWeb@42931 d1611594-4594-4d17-8e1d-87c2c4800839master
parent
0d92775689
commit
816ea80908
|
@ -34,7 +34,6 @@ public class TipoEventoExtra implements Serializable {
|
|||
public static short OPERACION_AJUSTE = 2;
|
||||
public static short OPERACION_CAMBIO_CHEQUE = 3;
|
||||
|
||||
|
||||
public static String TIPO_CREDITO = "1";
|
||||
public static String TIPO_DEBITO = "0";
|
||||
|
||||
|
@ -44,8 +43,8 @@ public class TipoEventoExtra implements Serializable {
|
|||
@GeneratedValue(strategy = GenerationType.AUTO, generator = "TIPO_EVENTO_EXTRA_SEQ")
|
||||
@Column(name = "TIPOEVENTOEXTRA_ID")
|
||||
private Integer tipoeventoextraId;
|
||||
//@Column(name = "DESCINGRESO")
|
||||
//private String descingreso;
|
||||
// @Column(name = "DESCINGRESO")
|
||||
// private String descingreso;
|
||||
@Column(name = "INDTIPO")
|
||||
private String indtipo;
|
||||
@Column(name = "IMPMAX")
|
||||
|
@ -58,8 +57,8 @@ public class TipoEventoExtra implements Serializable {
|
|||
private Boolean indcontrapartida;
|
||||
@Column(name = "INDBOLETO")
|
||||
private Boolean indboleto;
|
||||
// @Column(name = "INDAJUSTE")
|
||||
// private Boolean indajuste;
|
||||
// @Column(name = "INDAJUSTE")
|
||||
// private Boolean indajuste;
|
||||
@Column(name = "INDORDENSERVICIO")
|
||||
private Boolean indordenservicio;
|
||||
@Column(name = "INDOPERACION")
|
||||
|
@ -76,12 +75,16 @@ public class TipoEventoExtra implements Serializable {
|
|||
private Date fecmodif;
|
||||
@Column(name = "ACTIVO")
|
||||
private Boolean activo;
|
||||
// @Column(name = "DESCINGRESO2")
|
||||
// private String descingreso2;
|
||||
// @Column(name = "DESCINGRESO2")
|
||||
// private String descingreso2;
|
||||
@Column(name = "INDTIPO2")
|
||||
private String indtipo2;
|
||||
@Column(name = "DESCTIPOEVENTO")
|
||||
private String descTipoEvento;
|
||||
@Column(name = "NATUREZA")
|
||||
private String natureza;
|
||||
@Column(name = "CONTACONTABIL")
|
||||
private String contaContabil;
|
||||
|
||||
// @Column(name = "FORMAPAGO_ID")
|
||||
// private Integer formapagoId;
|
||||
|
@ -130,13 +133,13 @@ public class TipoEventoExtra implements Serializable {
|
|||
this.tipoeventoextraId = tipoeventoextraId;
|
||||
}
|
||||
|
||||
// public String getDescingreso() {
|
||||
// return descingreso;
|
||||
// }
|
||||
//
|
||||
// public void setDescingreso(String descingreso) {
|
||||
// this.descingreso = descingreso;
|
||||
// }
|
||||
// public String getDescingreso() {
|
||||
// return descingreso;
|
||||
// }
|
||||
//
|
||||
// public void setDescingreso(String descingreso) {
|
||||
// this.descingreso = descingreso;
|
||||
// }
|
||||
|
||||
public String getIndtipo() {
|
||||
return indtipo;
|
||||
|
@ -186,8 +189,6 @@ public class TipoEventoExtra implements Serializable {
|
|||
this.indboleto = indboleto;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public Boolean getIndordenservicio() {
|
||||
return indordenservicio;
|
||||
}
|
||||
|
@ -312,4 +313,20 @@ public class TipoEventoExtra implements Serializable {
|
|||
return "com.rjconsultores.ventaboletos.entidad.TipoEventoExtra[tipoeventoextraId="
|
||||
+ tipoeventoextraId + "]";
|
||||
}
|
||||
|
||||
public String getNatureza() {
|
||||
return natureza;
|
||||
}
|
||||
|
||||
public void setNatureza(String natureza) {
|
||||
this.natureza = natureza;
|
||||
}
|
||||
|
||||
public String getContaContabil() {
|
||||
return contaContabil;
|
||||
}
|
||||
|
||||
public void setContaContabil(String contaContabil) {
|
||||
this.contaContabil = contaContabil;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,6 +4,7 @@ import java.util.List;
|
|||
|
||||
import com.rjconsultores.ventaboletos.entidad.TipoEventoExtra;
|
||||
import com.rjconsultores.ventaboletos.exception.BusinessException;
|
||||
import com.rjconsultores.ventaboletos.exception.ValidacionCampoException;
|
||||
|
||||
public interface TipoEventoExtraService {
|
||||
|
||||
|
@ -13,9 +14,9 @@ public interface TipoEventoExtraService {
|
|||
|
||||
public TipoEventoExtra obtenerID(Integer id);
|
||||
|
||||
public TipoEventoExtra suscribir(TipoEventoExtra entidad);
|
||||
public TipoEventoExtra suscribir(TipoEventoExtra entidad) throws ValidacionCampoException;
|
||||
|
||||
public TipoEventoExtra actualizacion(TipoEventoExtra entidad);
|
||||
public TipoEventoExtra actualizacion(TipoEventoExtra entidad) throws ValidacionCampoException;
|
||||
|
||||
public void borrar(TipoEventoExtra entidad) throws BusinessException;
|
||||
}
|
||||
|
|
|
@ -4,18 +4,22 @@
|
|||
*/
|
||||
package com.rjconsultores.ventaboletos.service.impl;
|
||||
|
||||
import com.rjconsultores.ventaboletos.dao.TipoEventoExtraDAO;
|
||||
import com.rjconsultores.ventaboletos.entidad.TipoEventoExtra;
|
||||
import com.rjconsultores.ventaboletos.exception.BusinessException;
|
||||
import com.rjconsultores.ventaboletos.service.TipoEventoExtraService;
|
||||
import com.rjconsultores.ventaboletos.service.EventoExtraService;
|
||||
import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
|
||||
import java.util.Calendar;
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import com.rjconsultores.ventaboletos.dao.TipoEventoExtraDAO;
|
||||
import com.rjconsultores.ventaboletos.entidad.TipoEventoExtra;
|
||||
import com.rjconsultores.ventaboletos.exception.BusinessException;
|
||||
import com.rjconsultores.ventaboletos.exception.ValidacionCampoException;
|
||||
import com.rjconsultores.ventaboletos.service.EventoExtraService;
|
||||
import com.rjconsultores.ventaboletos.service.TipoEventoExtraService;
|
||||
import com.rjconsultores.ventaboletos.utilerias.ApplicationProperties;
|
||||
import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Administrador
|
||||
|
@ -35,25 +39,34 @@ public class TipoEventoExtraServiceImpl implements TipoEventoExtraService {
|
|||
public TipoEventoExtra obtenerID(Integer id) {
|
||||
return tipoEventoExtraDAO.obtenerID(id);
|
||||
}
|
||||
|
||||
@Transactional
|
||||
public TipoEventoExtra suscribir(TipoEventoExtra entidad) {
|
||||
public TipoEventoExtra suscribir(TipoEventoExtra entidad) throws ValidacionCampoException {
|
||||
entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||
entidad.setFecmodif(Calendar.getInstance().getTime());
|
||||
entidad.setActivo(Boolean.TRUE);
|
||||
|
||||
if (ApplicationProperties.getInstance().integracionTotvs()) {
|
||||
validaCampos(entidad);
|
||||
}
|
||||
|
||||
return tipoEventoExtraDAO.suscribir(entidad);
|
||||
}
|
||||
|
||||
@Transactional
|
||||
public TipoEventoExtra actualizacion(TipoEventoExtra entidad) {
|
||||
public TipoEventoExtra actualizacion(TipoEventoExtra entidad) throws ValidacionCampoException {
|
||||
entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||
entidad.setFecmodif(Calendar.getInstance().getTime());
|
||||
entidad.setActivo(Boolean.TRUE);
|
||||
|
||||
if (ApplicationProperties.getInstance().integracionTotvs()) {
|
||||
validaCampos(entidad);
|
||||
}
|
||||
|
||||
return tipoEventoExtraDAO.actualizacion(entidad);
|
||||
}
|
||||
|
||||
@Transactional(rollbackFor=BusinessException.class)
|
||||
@Transactional(rollbackFor = BusinessException.class)
|
||||
public void borrar(TipoEventoExtra entidad) throws BusinessException {
|
||||
|
||||
if (!eventoExtraService.obtenerPorTipo(entidad).isEmpty()) {
|
||||
|
@ -71,5 +84,15 @@ public class TipoEventoExtraServiceImpl implements TipoEventoExtraService {
|
|||
return tipoEventoExtraDAO.buscar(descingreso);
|
||||
}
|
||||
|
||||
private void validaCampos(TipoEventoExtra entidad) throws ValidacionCampoException {
|
||||
|
||||
if (entidad.getNatureza() == null) {
|
||||
throw new ValidacionCampoException("editarTipoEventoExtraController.MSG.natureza");
|
||||
}
|
||||
|
||||
if (entidad.getContaContabil() == null) {
|
||||
throw new ValidacionCampoException("editarTipoEventoExtraController.MSG.contaContabil");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue