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_AJUSTE = 2;
|
||||||
public static short OPERACION_CAMBIO_CHEQUE = 3;
|
public static short OPERACION_CAMBIO_CHEQUE = 3;
|
||||||
|
|
||||||
|
|
||||||
public static String TIPO_CREDITO = "1";
|
public static String TIPO_CREDITO = "1";
|
||||||
public static String TIPO_DEBITO = "0";
|
public static String TIPO_DEBITO = "0";
|
||||||
|
|
||||||
|
@ -44,8 +43,8 @@ public class TipoEventoExtra implements Serializable {
|
||||||
@GeneratedValue(strategy = GenerationType.AUTO, generator = "TIPO_EVENTO_EXTRA_SEQ")
|
@GeneratedValue(strategy = GenerationType.AUTO, generator = "TIPO_EVENTO_EXTRA_SEQ")
|
||||||
@Column(name = "TIPOEVENTOEXTRA_ID")
|
@Column(name = "TIPOEVENTOEXTRA_ID")
|
||||||
private Integer tipoeventoextraId;
|
private Integer tipoeventoextraId;
|
||||||
//@Column(name = "DESCINGRESO")
|
// @Column(name = "DESCINGRESO")
|
||||||
//private String descingreso;
|
// private String descingreso;
|
||||||
@Column(name = "INDTIPO")
|
@Column(name = "INDTIPO")
|
||||||
private String indtipo;
|
private String indtipo;
|
||||||
@Column(name = "IMPMAX")
|
@Column(name = "IMPMAX")
|
||||||
|
@ -58,8 +57,8 @@ public class TipoEventoExtra implements Serializable {
|
||||||
private Boolean indcontrapartida;
|
private Boolean indcontrapartida;
|
||||||
@Column(name = "INDBOLETO")
|
@Column(name = "INDBOLETO")
|
||||||
private Boolean indboleto;
|
private Boolean indboleto;
|
||||||
// @Column(name = "INDAJUSTE")
|
// @Column(name = "INDAJUSTE")
|
||||||
// private Boolean indajuste;
|
// private Boolean indajuste;
|
||||||
@Column(name = "INDORDENSERVICIO")
|
@Column(name = "INDORDENSERVICIO")
|
||||||
private Boolean indordenservicio;
|
private Boolean indordenservicio;
|
||||||
@Column(name = "INDOPERACION")
|
@Column(name = "INDOPERACION")
|
||||||
|
@ -76,12 +75,16 @@ public class TipoEventoExtra implements Serializable {
|
||||||
private Date fecmodif;
|
private Date fecmodif;
|
||||||
@Column(name = "ACTIVO")
|
@Column(name = "ACTIVO")
|
||||||
private Boolean activo;
|
private Boolean activo;
|
||||||
// @Column(name = "DESCINGRESO2")
|
// @Column(name = "DESCINGRESO2")
|
||||||
// private String descingreso2;
|
// private String descingreso2;
|
||||||
@Column(name = "INDTIPO2")
|
@Column(name = "INDTIPO2")
|
||||||
private String indtipo2;
|
private String indtipo2;
|
||||||
@Column(name = "DESCTIPOEVENTO")
|
@Column(name = "DESCTIPOEVENTO")
|
||||||
private String descTipoEvento;
|
private String descTipoEvento;
|
||||||
|
@Column(name = "NATUREZA")
|
||||||
|
private String natureza;
|
||||||
|
@Column(name = "CONTACONTABIL")
|
||||||
|
private String contaContabil;
|
||||||
|
|
||||||
// @Column(name = "FORMAPAGO_ID")
|
// @Column(name = "FORMAPAGO_ID")
|
||||||
// private Integer formapagoId;
|
// private Integer formapagoId;
|
||||||
|
@ -130,13 +133,13 @@ public class TipoEventoExtra implements Serializable {
|
||||||
this.tipoeventoextraId = tipoeventoextraId;
|
this.tipoeventoextraId = tipoeventoextraId;
|
||||||
}
|
}
|
||||||
|
|
||||||
// public String getDescingreso() {
|
// public String getDescingreso() {
|
||||||
// return descingreso;
|
// return descingreso;
|
||||||
// }
|
// }
|
||||||
//
|
//
|
||||||
// public void setDescingreso(String descingreso) {
|
// public void setDescingreso(String descingreso) {
|
||||||
// this.descingreso = descingreso;
|
// this.descingreso = descingreso;
|
||||||
// }
|
// }
|
||||||
|
|
||||||
public String getIndtipo() {
|
public String getIndtipo() {
|
||||||
return indtipo;
|
return indtipo;
|
||||||
|
@ -186,8 +189,6 @@ public class TipoEventoExtra implements Serializable {
|
||||||
this.indboleto = indboleto;
|
this.indboleto = indboleto;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public Boolean getIndordenservicio() {
|
public Boolean getIndordenservicio() {
|
||||||
return indordenservicio;
|
return indordenservicio;
|
||||||
}
|
}
|
||||||
|
@ -312,4 +313,20 @@ public class TipoEventoExtra implements Serializable {
|
||||||
return "com.rjconsultores.ventaboletos.entidad.TipoEventoExtra[tipoeventoextraId="
|
return "com.rjconsultores.ventaboletos.entidad.TipoEventoExtra[tipoeventoextraId="
|
||||||
+ 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.entidad.TipoEventoExtra;
|
||||||
import com.rjconsultores.ventaboletos.exception.BusinessException;
|
import com.rjconsultores.ventaboletos.exception.BusinessException;
|
||||||
|
import com.rjconsultores.ventaboletos.exception.ValidacionCampoException;
|
||||||
|
|
||||||
public interface TipoEventoExtraService {
|
public interface TipoEventoExtraService {
|
||||||
|
|
||||||
|
@ -13,9 +14,9 @@ public interface TipoEventoExtraService {
|
||||||
|
|
||||||
public TipoEventoExtra obtenerID(Integer id);
|
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;
|
public void borrar(TipoEventoExtra entidad) throws BusinessException;
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,18 +4,22 @@
|
||||||
*/
|
*/
|
||||||
package com.rjconsultores.ventaboletos.service.impl;
|
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.Calendar;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
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
|
* @author Administrador
|
||||||
|
@ -23,53 +27,72 @@ import org.springframework.transaction.annotation.Transactional;
|
||||||
@Service("tipoEventoExtraService")
|
@Service("tipoEventoExtraService")
|
||||||
public class TipoEventoExtraServiceImpl implements TipoEventoExtraService {
|
public class TipoEventoExtraServiceImpl implements TipoEventoExtraService {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private TipoEventoExtraDAO tipoEventoExtraDAO;
|
private TipoEventoExtraDAO tipoEventoExtraDAO;
|
||||||
@Autowired
|
@Autowired
|
||||||
private EventoExtraService eventoExtraService;
|
private EventoExtraService eventoExtraService;
|
||||||
|
|
||||||
public List<TipoEventoExtra> obtenerTodos() {
|
public List<TipoEventoExtra> obtenerTodos() {
|
||||||
return tipoEventoExtraDAO.obtenerTodos();
|
return tipoEventoExtraDAO.obtenerTodos();
|
||||||
}
|
}
|
||||||
|
|
||||||
public TipoEventoExtra obtenerID(Integer id) {
|
public TipoEventoExtra obtenerID(Integer id) {
|
||||||
return tipoEventoExtraDAO.obtenerID(id);
|
return tipoEventoExtraDAO.obtenerID(id);
|
||||||
}
|
}
|
||||||
@Transactional
|
|
||||||
public TipoEventoExtra suscribir(TipoEventoExtra entidad) {
|
|
||||||
entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
|
||||||
entidad.setFecmodif(Calendar.getInstance().getTime());
|
|
||||||
entidad.setActivo(Boolean.TRUE);
|
|
||||||
|
|
||||||
return tipoEventoExtraDAO.suscribir(entidad);
|
@Transactional
|
||||||
}
|
public TipoEventoExtra suscribir(TipoEventoExtra entidad) throws ValidacionCampoException {
|
||||||
|
entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||||
|
entidad.setFecmodif(Calendar.getInstance().getTime());
|
||||||
|
entidad.setActivo(Boolean.TRUE);
|
||||||
|
|
||||||
@Transactional
|
if (ApplicationProperties.getInstance().integracionTotvs()) {
|
||||||
public TipoEventoExtra actualizacion(TipoEventoExtra entidad) {
|
validaCampos(entidad);
|
||||||
entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
}
|
||||||
entidad.setFecmodif(Calendar.getInstance().getTime());
|
|
||||||
entidad.setActivo(Boolean.TRUE);
|
|
||||||
|
|
||||||
return tipoEventoExtraDAO.actualizacion(entidad);
|
return tipoEventoExtraDAO.suscribir(entidad);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional(rollbackFor=BusinessException.class)
|
@Transactional
|
||||||
public void borrar(TipoEventoExtra entidad) throws BusinessException {
|
public TipoEventoExtra actualizacion(TipoEventoExtra entidad) throws ValidacionCampoException {
|
||||||
|
entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||||
|
entidad.setFecmodif(Calendar.getInstance().getTime());
|
||||||
|
entidad.setActivo(Boolean.TRUE);
|
||||||
|
|
||||||
if (!eventoExtraService.obtenerPorTipo(entidad).isEmpty()) {
|
if (ApplicationProperties.getInstance().integracionTotvs()) {
|
||||||
throw new BusinessException("editarTipoEventoExtraController.MSG.evento");
|
validaCampos(entidad);
|
||||||
}
|
}
|
||||||
entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
|
||||||
entidad.setFecmodif(Calendar.getInstance().getTime());
|
|
||||||
entidad.setActivo(Boolean.FALSE);
|
|
||||||
|
|
||||||
tipoEventoExtraDAO.actualizacion(entidad);
|
return tipoEventoExtraDAO.actualizacion(entidad);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Transactional(rollbackFor = BusinessException.class)
|
||||||
|
public void borrar(TipoEventoExtra entidad) throws BusinessException {
|
||||||
|
|
||||||
|
if (!eventoExtraService.obtenerPorTipo(entidad).isEmpty()) {
|
||||||
|
throw new BusinessException("editarTipoEventoExtraController.MSG.evento");
|
||||||
|
}
|
||||||
|
entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||||
|
entidad.setFecmodif(Calendar.getInstance().getTime());
|
||||||
|
entidad.setActivo(Boolean.FALSE);
|
||||||
|
|
||||||
|
tipoEventoExtraDAO.actualizacion(entidad);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<TipoEventoExtra> buscar(String descingreso) {
|
public List<TipoEventoExtra> buscar(String descingreso) {
|
||||||
return tipoEventoExtraDAO.buscar(descingreso);
|
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