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";
|
||||
|
||||
|
@ -82,6 +81,10 @@ public class TipoEventoExtra implements Serializable {
|
|||
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;
|
||||
|
@ -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,21 +39,30 @@ 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);
|
||||
}
|
||||
|
||||
|
@ -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