Sfoglia il codice sorgente

Fix IOException nuove asseverazioni

master
Salvatore La Manna 4 anni fa
parent
commit
52f3cdb220
  1. BIN
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/lib/util-java.jar
  2. 9
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/bo/service/AsseverazioneService.java
  3. 21
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/bo/service/AsseverazioneServiceClp.java
  4. 9
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/bo/service/AsseverazioneServiceUtil.java
  5. 9
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/bo/service/AsseverazioneServiceWrapper.java
  6. 12
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/bo/service/DettPraticaLocalService.java
  7. 28
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/bo/service/DettPraticaLocalServiceClp.java
  8. 12
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/bo/service/DettPraticaLocalServiceUtil.java
  9. 12
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/bo/service/DettPraticaLocalServiceWrapper.java
  10. 335
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/AsseverazioneServiceImpl.java
  11. 11
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/DettPraticaLocalServiceImpl.java
  12. 880
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/util/PagamentiUtil.java
  13. 4
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/service.properties

BIN
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/lib/util-java.jar

File binario non mostrato.

9
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/bo/service/AsseverazioneService.java

@ -67,13 +67,15 @@ public interface AsseverazioneService extends BaseService, InvokableService {
public void cambioStatoAsseverazione(long asseverazioneId,
java.lang.String stato)
throws com.liferay.portal.kernel.exception.PortalException,
com.liferay.portal.kernel.exception.SystemException;
com.liferay.portal.kernel.exception.SystemException,
java.io.IOException;
public void cambioStatoAsseverazioni(long dettPraticaId,
java.lang.String stato)
throws com.liferay.portal.kernel.exception.PortalException,
com.liferay.portal.kernel.exception.SystemException,
com.liferay.portal.security.auth.PrincipalException;
com.liferay.portal.security.auth.PrincipalException,
java.io.IOException;
public void richiediAsseverazioni(long dettPraticaId,
com.liferay.portal.service.ServiceContext serviceContext)
@ -88,7 +90,8 @@ public interface AsseverazioneService extends BaseService, InvokableService {
public void annullaAsseverazioni(long dettPraticaId)
throws com.liferay.portal.kernel.exception.PortalException,
com.liferay.portal.kernel.exception.SystemException,
com.liferay.portal.security.auth.PrincipalException;
com.liferay.portal.security.auth.PrincipalException,
java.io.IOException;
public void rimuoviFileAsseverazione(long asseverazioneId)
throws com.liferay.portal.kernel.exception.PortalException,

21
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/bo/service/AsseverazioneServiceClp.java

@ -268,7 +268,8 @@ public class AsseverazioneServiceClp implements AsseverazioneService {
public void cambioStatoAsseverazione(long asseverazioneId,
java.lang.String stato)
throws com.liferay.portal.kernel.exception.PortalException,
com.liferay.portal.kernel.exception.SystemException {
com.liferay.portal.kernel.exception.SystemException,
java.io.IOException {
try {
_invokableService.invokeMethod(_methodName3,
_methodParameterTypes3,
@ -289,6 +290,10 @@ public class AsseverazioneServiceClp implements AsseverazioneService {
throw (com.liferay.portal.kernel.exception.SystemException)t;
}
if (t instanceof java.io.IOException) {
throw (java.io.IOException)t;
}
if (t instanceof RuntimeException) {
throw (RuntimeException)t;
}
@ -304,7 +309,8 @@ public class AsseverazioneServiceClp implements AsseverazioneService {
java.lang.String stato)
throws com.liferay.portal.kernel.exception.PortalException,
com.liferay.portal.kernel.exception.SystemException,
com.liferay.portal.security.auth.PrincipalException {
com.liferay.portal.security.auth.PrincipalException,
java.io.IOException {
try {
_invokableService.invokeMethod(_methodName4,
_methodParameterTypes4,
@ -326,6 +332,10 @@ public class AsseverazioneServiceClp implements AsseverazioneService {
throw (com.liferay.portal.security.auth.PrincipalException)t;
}
if (t instanceof java.io.IOException) {
throw (java.io.IOException)t;
}
if (t instanceof RuntimeException) {
throw (RuntimeException)t;
}
@ -410,7 +420,8 @@ public class AsseverazioneServiceClp implements AsseverazioneService {
public void annullaAsseverazioni(long dettPraticaId)
throws com.liferay.portal.kernel.exception.PortalException,
com.liferay.portal.kernel.exception.SystemException,
com.liferay.portal.security.auth.PrincipalException {
com.liferay.portal.security.auth.PrincipalException,
java.io.IOException {
try {
_invokableService.invokeMethod(_methodName7,
_methodParameterTypes7, new Object[] { dettPraticaId });
@ -430,6 +441,10 @@ public class AsseverazioneServiceClp implements AsseverazioneService {
throw (com.liferay.portal.security.auth.PrincipalException)t;
}
if (t instanceof java.io.IOException) {
throw (java.io.IOException)t;
}
if (t instanceof RuntimeException) {
throw (RuntimeException)t;
}

9
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/bo/service/AsseverazioneServiceUtil.java

@ -66,7 +66,8 @@ public class AsseverazioneServiceUtil {
public static void cambioStatoAsseverazione(long asseverazioneId,
java.lang.String stato)
throws com.liferay.portal.kernel.exception.PortalException,
com.liferay.portal.kernel.exception.SystemException {
com.liferay.portal.kernel.exception.SystemException,
java.io.IOException {
getService().cambioStatoAsseverazione(asseverazioneId, stato);
}
@ -74,7 +75,8 @@ public class AsseverazioneServiceUtil {
java.lang.String stato)
throws com.liferay.portal.kernel.exception.PortalException,
com.liferay.portal.kernel.exception.SystemException,
com.liferay.portal.security.auth.PrincipalException {
com.liferay.portal.security.auth.PrincipalException,
java.io.IOException {
getService().cambioStatoAsseverazioni(dettPraticaId, stato);
}
@ -96,7 +98,8 @@ public class AsseverazioneServiceUtil {
public static void annullaAsseverazioni(long dettPraticaId)
throws com.liferay.portal.kernel.exception.PortalException,
com.liferay.portal.kernel.exception.SystemException,
com.liferay.portal.security.auth.PrincipalException {
com.liferay.portal.security.auth.PrincipalException,
java.io.IOException {
getService().annullaAsseverazioni(dettPraticaId);
}

9
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/bo/service/AsseverazioneServiceWrapper.java

@ -62,7 +62,8 @@ public class AsseverazioneServiceWrapper implements AsseverazioneService,
public void cambioStatoAsseverazione(long asseverazioneId,
java.lang.String stato)
throws com.liferay.portal.kernel.exception.PortalException,
com.liferay.portal.kernel.exception.SystemException {
com.liferay.portal.kernel.exception.SystemException,
java.io.IOException {
_asseverazioneService.cambioStatoAsseverazione(asseverazioneId, stato);
}
@ -71,7 +72,8 @@ public class AsseverazioneServiceWrapper implements AsseverazioneService,
java.lang.String stato)
throws com.liferay.portal.kernel.exception.PortalException,
com.liferay.portal.kernel.exception.SystemException,
com.liferay.portal.security.auth.PrincipalException {
com.liferay.portal.security.auth.PrincipalException,
java.io.IOException {
_asseverazioneService.cambioStatoAsseverazioni(dettPraticaId, stato);
}
@ -96,7 +98,8 @@ public class AsseverazioneServiceWrapper implements AsseverazioneService,
public void annullaAsseverazioni(long dettPraticaId)
throws com.liferay.portal.kernel.exception.PortalException,
com.liferay.portal.kernel.exception.SystemException,
com.liferay.portal.security.auth.PrincipalException {
com.liferay.portal.security.auth.PrincipalException,
java.io.IOException {
_asseverazioneService.annullaAsseverazioni(dettPraticaId);
}

12
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/bo/service/DettPraticaLocalService.java

@ -755,12 +755,14 @@ public interface DettPraticaLocalService extends BaseLocalService,
public void updateEsitoPagamento(long pagamentoId, long dettPraticaId,
java.lang.String stato)
throws com.liferay.portal.kernel.exception.PortalException,
com.liferay.portal.kernel.exception.SystemException;
com.liferay.portal.kernel.exception.SystemException,
java.io.IOException;
public void updateEsitoPagamento(long pagamentoId, long dettPraticaId,
long fileEntryId, java.lang.String stato)
throws com.liferay.portal.kernel.exception.PortalException,
com.liferay.portal.kernel.exception.SystemException;
com.liferay.portal.kernel.exception.SystemException,
java.io.IOException;
@Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
public boolean isControlloObbligatorio(
@ -769,12 +771,14 @@ public interface DettPraticaLocalService extends BaseLocalService,
public it.tref.liferay.portos.bo.model.DettPratica updateEsito(
long dettPraticaId, int stato)
throws com.liferay.portal.kernel.exception.PortalException,
com.liferay.portal.kernel.exception.SystemException;
com.liferay.portal.kernel.exception.SystemException,
java.io.IOException;
public it.tref.liferay.portos.bo.model.DettPratica updateEsitoIntegrazione(
long dettPraticaId, int stato)
throws com.liferay.portal.kernel.exception.PortalException,
com.liferay.portal.kernel.exception.SystemException;
com.liferay.portal.kernel.exception.SystemException,
java.io.IOException;
public it.tref.liferay.portos.bo.model.DettPratica pagaInvia(
long dettPraticaId, int pagAdeguamentoSismico, int pagAltro,

28
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/bo/service/DettPraticaLocalServiceClp.java

@ -3387,7 +3387,8 @@ public class DettPraticaLocalServiceClp implements DettPraticaLocalService {
public void updateEsitoPagamento(long pagamentoId, long dettPraticaId,
java.lang.String stato)
throws com.liferay.portal.kernel.exception.PortalException,
com.liferay.portal.kernel.exception.SystemException {
com.liferay.portal.kernel.exception.SystemException,
java.io.IOException {
try {
_invokableLocalService.invokeMethod(_methodName47,
_methodParameterTypes47,
@ -3410,6 +3411,10 @@ public class DettPraticaLocalServiceClp implements DettPraticaLocalService {
throw (com.liferay.portal.kernel.exception.SystemException)t;
}
if (t instanceof java.io.IOException) {
throw (java.io.IOException)t;
}
if (t instanceof RuntimeException) {
throw (RuntimeException)t;
}
@ -3424,7 +3429,8 @@ public class DettPraticaLocalServiceClp implements DettPraticaLocalService {
public void updateEsitoPagamento(long pagamentoId, long dettPraticaId,
long fileEntryId, java.lang.String stato)
throws com.liferay.portal.kernel.exception.PortalException,
com.liferay.portal.kernel.exception.SystemException {
com.liferay.portal.kernel.exception.SystemException,
java.io.IOException {
try {
_invokableLocalService.invokeMethod(_methodName48,
_methodParameterTypes48,
@ -3449,6 +3455,10 @@ public class DettPraticaLocalServiceClp implements DettPraticaLocalService {
throw (com.liferay.portal.kernel.exception.SystemException)t;
}
if (t instanceof java.io.IOException) {
throw (java.io.IOException)t;
}
if (t instanceof RuntimeException) {
throw (RuntimeException)t;
}
@ -3488,7 +3498,8 @@ public class DettPraticaLocalServiceClp implements DettPraticaLocalService {
public it.tref.liferay.portos.bo.model.DettPratica updateEsito(
long dettPraticaId, int stato)
throws com.liferay.portal.kernel.exception.PortalException,
com.liferay.portal.kernel.exception.SystemException {
com.liferay.portal.kernel.exception.SystemException,
java.io.IOException {
Object returnObj = null;
try {
@ -3507,6 +3518,10 @@ public class DettPraticaLocalServiceClp implements DettPraticaLocalService {
throw (com.liferay.portal.kernel.exception.SystemException)t;
}
if (t instanceof java.io.IOException) {
throw (java.io.IOException)t;
}
if (t instanceof RuntimeException) {
throw (RuntimeException)t;
}
@ -3523,7 +3538,8 @@ public class DettPraticaLocalServiceClp implements DettPraticaLocalService {
public it.tref.liferay.portos.bo.model.DettPratica updateEsitoIntegrazione(
long dettPraticaId, int stato)
throws com.liferay.portal.kernel.exception.PortalException,
com.liferay.portal.kernel.exception.SystemException {
com.liferay.portal.kernel.exception.SystemException,
java.io.IOException {
Object returnObj = null;
try {
@ -3542,6 +3558,10 @@ public class DettPraticaLocalServiceClp implements DettPraticaLocalService {
throw (com.liferay.portal.kernel.exception.SystemException)t;
}
if (t instanceof java.io.IOException) {
throw (java.io.IOException)t;
}
if (t instanceof RuntimeException) {
throw (RuntimeException)t;
}

12
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/bo/service/DettPraticaLocalServiceUtil.java

@ -1017,14 +1017,16 @@ public class DettPraticaLocalServiceUtil {
public static void updateEsitoPagamento(long pagamentoId,
long dettPraticaId, java.lang.String stato)
throws com.liferay.portal.kernel.exception.PortalException,
com.liferay.portal.kernel.exception.SystemException {
com.liferay.portal.kernel.exception.SystemException,
java.io.IOException {
getService().updateEsitoPagamento(pagamentoId, dettPraticaId, stato);
}
public static void updateEsitoPagamento(long pagamentoId,
long dettPraticaId, long fileEntryId, java.lang.String stato)
throws com.liferay.portal.kernel.exception.PortalException,
com.liferay.portal.kernel.exception.SystemException {
com.liferay.portal.kernel.exception.SystemException,
java.io.IOException {
getService()
.updateEsitoPagamento(pagamentoId, dettPraticaId, fileEntryId, stato);
}
@ -1037,14 +1039,16 @@ public class DettPraticaLocalServiceUtil {
public static it.tref.liferay.portos.bo.model.DettPratica updateEsito(
long dettPraticaId, int stato)
throws com.liferay.portal.kernel.exception.PortalException,
com.liferay.portal.kernel.exception.SystemException {
com.liferay.portal.kernel.exception.SystemException,
java.io.IOException {
return getService().updateEsito(dettPraticaId, stato);
}
public static it.tref.liferay.portos.bo.model.DettPratica updateEsitoIntegrazione(
long dettPraticaId, int stato)
throws com.liferay.portal.kernel.exception.PortalException,
com.liferay.portal.kernel.exception.SystemException {
com.liferay.portal.kernel.exception.SystemException,
java.io.IOException {
return getService().updateEsitoIntegrazione(dettPraticaId, stato);
}

12
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/bo/service/DettPraticaLocalServiceWrapper.java

@ -1048,7 +1048,8 @@ public class DettPraticaLocalServiceWrapper implements DettPraticaLocalService,
public void updateEsitoPagamento(long pagamentoId, long dettPraticaId,
java.lang.String stato)
throws com.liferay.portal.kernel.exception.PortalException,
com.liferay.portal.kernel.exception.SystemException {
com.liferay.portal.kernel.exception.SystemException,
java.io.IOException {
_dettPraticaLocalService.updateEsitoPagamento(pagamentoId,
dettPraticaId, stato);
}
@ -1057,7 +1058,8 @@ public class DettPraticaLocalServiceWrapper implements DettPraticaLocalService,
public void updateEsitoPagamento(long pagamentoId, long dettPraticaId,
long fileEntryId, java.lang.String stato)
throws com.liferay.portal.kernel.exception.PortalException,
com.liferay.portal.kernel.exception.SystemException {
com.liferay.portal.kernel.exception.SystemException,
java.io.IOException {
_dettPraticaLocalService.updateEsitoPagamento(pagamentoId,
dettPraticaId, fileEntryId, stato);
}
@ -1072,7 +1074,8 @@ public class DettPraticaLocalServiceWrapper implements DettPraticaLocalService,
public it.tref.liferay.portos.bo.model.DettPratica updateEsito(
long dettPraticaId, int stato)
throws com.liferay.portal.kernel.exception.PortalException,
com.liferay.portal.kernel.exception.SystemException {
com.liferay.portal.kernel.exception.SystemException,
java.io.IOException {
return _dettPraticaLocalService.updateEsito(dettPraticaId, stato);
}
@ -1080,7 +1083,8 @@ public class DettPraticaLocalServiceWrapper implements DettPraticaLocalService,
public it.tref.liferay.portos.bo.model.DettPratica updateEsitoIntegrazione(
long dettPraticaId, int stato)
throws com.liferay.portal.kernel.exception.PortalException,
com.liferay.portal.kernel.exception.SystemException {
com.liferay.portal.kernel.exception.SystemException,
java.io.IOException {
return _dettPraticaLocalService.updateEsitoIntegrazione(dettPraticaId,
stato);
}

335
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/AsseverazioneServiceImpl.java

@ -16,6 +16,7 @@ import it.tref.liferay.portos.bo.model.Asseverazione;
import it.tref.liferay.portos.bo.service.base.AsseverazioneServiceBaseImpl;
import it.tref.liferay.portos.bo.util.AsseverazioniUtil;
import java.io.IOException;
import java.util.List;
import com.liferay.portal.kernel.exception.PortalException;
@ -29,13 +30,14 @@ import com.liferay.portal.service.ServiceContext;
* The implementation of the asseverazione remote service.
*
* <p>
* All custom service methods should be put in this class. Whenever methods are added, rerun
* ServiceBuilder to copy their definitions into the
* All custom service methods should be put in this class. Whenever methods are
* added, rerun ServiceBuilder to copy their definitions into the
* {@link it.tref.liferay.portos.bo.service.AsseverazioneService} interface.
*
* <p>
* This is a remote service. Methods of this service are expected to have security checks based on
* the propagated JAAS credentials because this service can be accessed remotely.
* This is a remote service. Methods of this service are expected to have
* security checks based on the propagated JAAS credentials because this service
* can be accessed remotely.
* </p>
*
* @author Davide Barbagallo, 3F Consulting
@ -43,223 +45,238 @@ import com.liferay.portal.service.ServiceContext;
* @see it.tref.liferay.portos.bo.service.AsseverazioneServiceUtil
*/
public class AsseverazioneServiceImpl extends AsseverazioneServiceBaseImpl {
/*
* NOTE FOR DEVELOPERS: Never reference this interface directly. Always use {@link
* it.tref.liferay.portos.bo.service.AsseverazioneServiceUtil} to access the asseverazione remote
* service.
*/
/*
* NOTE FOR DEVELOPERS: Never reference this interface directly. Always use
* {@link it.tref.liferay.portos.bo.service.AsseverazioneServiceUtil} to
* access the asseverazione remote service.
*/
public void cambioStatoAsseverazione(long asseverazioneId, String stato) throws SystemException, PortalException {
public void cambioStatoAsseverazione(long asseverazioneId, String stato) throws IOException,
SystemException, PortalException {
if (AsseverazioniUtil.hasCambioStatoAsseverazione(getUserId(), asseverazioneId)) {
asseverazioneLocalService.cambioStatoAsseverazione(getUserId(), asseverazioneId, stato);
} else {
throw new SystemException("annulla-asseverazione-non-possibile");
}
if (AsseverazioniUtil.hasCambioStatoAsseverazione(getUserId(), asseverazioneId)) {
asseverazioneLocalService.cambioStatoAsseverazione(getUserId(), asseverazioneId, stato);
} else {
throw new SystemException("annulla-asseverazione-non-possibile");
}
}
}
public void cambioStatoAsseverazioni(long dettPraticaId, String stato) throws SystemException, PrincipalException,
PortalException {
public void cambioStatoAsseverazioni(long dettPraticaId, String stato) throws IOException,
SystemException, PrincipalException, PortalException {
if (AsseverazioniUtil.hasRichiediAsseverazioni(getUserId(), dettPraticaId)) {
asseverazioneLocalService.cambioStatoAsseverazioni(dettPraticaId, stato);
} else {
throw new SystemException("annulla-asseverazione-non-possibile");
}
}
if (AsseverazioniUtil.hasRichiediAsseverazioni(getUserId(), dettPraticaId)) {
asseverazioneLocalService.cambioStatoAsseverazioni(dettPraticaId, stato);
} else {
throw new SystemException("annulla-asseverazione-non-possibile");
}
}
public void richiediAsseverazioni(long dettPraticaId, ServiceContext serviceContext) throws PrincipalException,
PortalException, SystemException {
public void richiediAsseverazioni(long dettPraticaId, ServiceContext serviceContext)
throws PrincipalException, PortalException, SystemException {
if (AsseverazioniUtil.hasRichiediAsseverazioni(getUserId(), dettPraticaId)) {
asseverazioneLocalService.richiediAsseverazioni(dettPraticaId, serviceContext);
} else {
throw new SystemException("richiedi-asseverazione-non-possibile");
}
}
if (AsseverazioniUtil.hasRichiediAsseverazioni(getUserId(), dettPraticaId)) {
asseverazioneLocalService.richiediAsseverazioni(dettPraticaId, serviceContext);
} else {
throw new SystemException("richiedi-asseverazione-non-possibile");
}
}
public void resetAsseverazione(long dettPraticaId, long asseverazioneId) throws PortalException, SystemException {
public void resetAsseverazione(long dettPraticaId, long asseverazioneId) throws PortalException,
SystemException {
if (AsseverazioniUtil.hasAnnullaAsseverazioni(getUserId(), dettPraticaId)) {
asseverazioneLocalService.resetAsseverazione(asseverazioneId);
} else {
throw new SystemException("reset-asseverazione-non-possibile");
}
}
if (AsseverazioniUtil.hasAnnullaAsseverazioni(getUserId(), dettPraticaId)) {
asseverazioneLocalService.resetAsseverazione(asseverazioneId);
} else {
throw new SystemException("reset-asseverazione-non-possibile");
}
}
public void annullaAsseverazioni(long dettPraticaId) throws PrincipalException, PortalException, SystemException {
public void annullaAsseverazioni(long dettPraticaId) throws IOException, PrincipalException,
PortalException, SystemException {
if (AsseverazioniUtil.hasAnnullaAsseverazioni(getUserId(), dettPraticaId)) {
asseverazioneLocalService.annullaAsseverazioni(dettPraticaId);
} else {
throw new SystemException("annulla-asseverazione-non-possibile");
}
}
if (AsseverazioniUtil.hasAnnullaAsseverazioni(getUserId(), dettPraticaId)) {
asseverazioneLocalService.annullaAsseverazioni(dettPraticaId);
} else {
throw new SystemException("annulla-asseverazione-non-possibile");
}
}
public void rimuoviFileAsseverazione(long asseverazioneId) throws SystemException, PortalException {
public void rimuoviFileAsseverazione(long asseverazioneId) throws SystemException, PortalException {
if (AsseverazioniUtil.hasGestisciFileAsseverazione(getUserId(), asseverazioneId)) {
asseverazioneLocalService.rimuoviFileAsseverazione(asseverazioneId);
} else {
throw new SystemException("annulla-asseverazione-non-possibile");
}
}
if (AsseverazioniUtil.hasGestisciFileAsseverazione(getUserId(), asseverazioneId)) {
asseverazioneLocalService.rimuoviFileAsseverazione(asseverazioneId);
} else {
throw new SystemException("annulla-asseverazione-non-possibile");
}
}
public FileEntry allegaFileAsseverazione(long asseverazioneId, byte[] content, String sourceFileName,
ServiceContext serviceContext) throws SystemException, PortalException {
public FileEntry allegaFileAsseverazione(long asseverazioneId, byte[] content, String sourceFileName,
ServiceContext serviceContext) throws SystemException, PortalException {
if (AsseverazioniUtil.hasGestisciFileAsseverazione(getUserId(), asseverazioneId)) {
return asseverazioneLocalService.allegaFileAsseverazione(asseverazioneId, content, sourceFileName, serviceContext);
} else {
throw new SystemException("annulla-asseverazione-non-possibile");
}
}
if (AsseverazioniUtil.hasGestisciFileAsseverazione(getUserId(), asseverazioneId)) {
return asseverazioneLocalService.allegaFileAsseverazione(asseverazioneId, content,
sourceFileName, serviceContext);
} else {
throw new SystemException("annulla-asseverazione-non-possibile");
}
}
public List<Asseverazione> findByIntPratica(long intPraticaId, int start, int end, OrderByComparator orderByComparator)
throws SystemException {
public List<Asseverazione> findByIntPratica(long intPraticaId, int start, int end,
OrderByComparator orderByComparator) throws SystemException {
return asseverazioneLocalService.findByIntPratica(intPraticaId, start, end, orderByComparator);
}
return asseverazioneLocalService.findByIntPratica(intPraticaId, start, end, orderByComparator);
}
public List<Asseverazione> findByDettPratica(long dettPraticaId, int start, int end,
OrderByComparator orderByComparator) throws SystemException {
public List<Asseverazione> findByDettPratica(long dettPraticaId, int start, int end,
OrderByComparator orderByComparator) throws SystemException {
return asseverazioneLocalService.findByDettPratica(dettPraticaId, start, end, orderByComparator);
}
return asseverazioneLocalService.findByDettPratica(dettPraticaId, start, end, orderByComparator);
}
public int countByIntPratica(long intPraticaId) throws SystemException {
public int countByIntPratica(long intPraticaId) throws SystemException {
return asseverazioneLocalService.countByIntPratica(intPraticaId);
}
return asseverazioneLocalService.countByIntPratica(intPraticaId);
}
public int countByDettPratica(long dettPraticaId) throws SystemException {
public int countByDettPratica(long dettPraticaId) throws SystemException {
return asseverazioneLocalService.countByDettPratica(dettPraticaId);
}
return asseverazioneLocalService.countByDettPratica(dettPraticaId);
}
public List<Asseverazione> findByIntPratica_CodiceFiscale(long intPraticaId, String codiceFiscale, int start,
int end, OrderByComparator orderByComparator) throws SystemException {
public List<Asseverazione> findByIntPratica_CodiceFiscale(long intPraticaId, String codiceFiscale,
int start, int end, OrderByComparator orderByComparator) throws SystemException {
return asseverazioneLocalService.findByIntPratica_CodiceFiscale(intPraticaId, codiceFiscale, start, end,
orderByComparator);
}
return asseverazioneLocalService.findByIntPratica_CodiceFiscale(intPraticaId, codiceFiscale, start,
end, orderByComparator);
}
public int countByIntPratica_CodiceFiscale(long intPraticaId, String codiceFiscale) throws SystemException {
public int countByIntPratica_CodiceFiscale(long intPraticaId, String codiceFiscale)
throws SystemException {
return asseverazioneLocalService.countByIntPratica_CodiceFiscale(intPraticaId, codiceFiscale);
}
return asseverazioneLocalService.countByIntPratica_CodiceFiscale(intPraticaId, codiceFiscale);
}
public List<Asseverazione> findByCodiceFiscale_InEsito(String codiceFiscale, String[] esiti, int start, int end,
OrderByComparator orderByComparator) throws SystemException {
public List<Asseverazione> findByCodiceFiscale_InEsito(String codiceFiscale, String[] esiti, int start,
int end, OrderByComparator orderByComparator) throws SystemException {
return asseverazioneLocalService.findByCodiceFiscale_InEsito(codiceFiscale, esiti, start, end, orderByComparator);
}
return asseverazioneLocalService.findByCodiceFiscale_InEsito(codiceFiscale, esiti, start, end,
orderByComparator);
}
public int countByCodiceFiscale_InEsito(String codiceFiscale, String[] esiti) throws SystemException {
public int countByCodiceFiscale_InEsito(String codiceFiscale, String[] esiti) throws SystemException {
return asseverazioneLocalService.countByCodiceFiscale_InEsito(codiceFiscale, esiti);
}
return asseverazioneLocalService.countByCodiceFiscale_InEsito(codiceFiscale, esiti);
}
public List<Asseverazione> findByIntPratica_CodiceFiscale_InEsito(long intPraticaId, String codiceFiscale,
String[] esiti, int start, int end, OrderByComparator orderByComparator) throws SystemException {
public List<Asseverazione> findByIntPratica_CodiceFiscale_InEsito(long intPraticaId,
String codiceFiscale, String[] esiti, int start, int end, OrderByComparator orderByComparator)
throws SystemException {
return asseverazioneLocalService.findByIntPratica_CodiceFiscale_InEsito(intPraticaId, codiceFiscale, esiti, start,
end, orderByComparator);
}
return asseverazioneLocalService.findByIntPratica_CodiceFiscale_InEsito(intPraticaId, codiceFiscale,
esiti, start, end, orderByComparator);
}
public List<Asseverazione> findByDettPratica_CodiceFiscale_InEsito(long dettPraticaId, String codiceFiscale,
String[] esiti, int start, int end, OrderByComparator orderByComparator) throws SystemException {
public List<Asseverazione> findByDettPratica_CodiceFiscale_InEsito(long dettPraticaId,
String codiceFiscale, String[] esiti, int start, int end, OrderByComparator orderByComparator)
throws SystemException {
return asseverazioneLocalService.findByDettPratica_CodiceFiscale_InEsito(dettPraticaId, codiceFiscale, esiti,
start, end, orderByComparator);
}
return asseverazioneLocalService.findByDettPratica_CodiceFiscale_InEsito(dettPraticaId,
codiceFiscale, esiti, start, end, orderByComparator);
}
public int countByIntPratica_CodiceFiscale_InEsito(long intPraticaId, String codiceFiscale, String[] esiti)
throws SystemException {
public int countByIntPratica_CodiceFiscale_InEsito(long intPraticaId, String codiceFiscale, String[] esiti)
throws SystemException {
return asseverazioneLocalService.countByIntPratica_CodiceFiscale_InEsito(intPraticaId, codiceFiscale, esiti);
}
return asseverazioneLocalService.countByIntPratica_CodiceFiscale_InEsito(intPraticaId, codiceFiscale,
esiti);
}
public int countByDettPratica_CodiceFiscale_InEsito(long dettPraticaId, String codiceFiscale, String[] esiti)
throws SystemException {
public int countByDettPratica_CodiceFiscale_InEsito(long dettPraticaId, String codiceFiscale,
String[] esiti) throws SystemException {
return asseverazioneLocalService.countByDettPratica_CodiceFiscale_InEsito(dettPraticaId, codiceFiscale, esiti);
}
return asseverazioneLocalService.countByDettPratica_CodiceFiscale_InEsito(dettPraticaId,
codiceFiscale, esiti);
}
public List<Asseverazione> findByIntPratica_InEsito(long intPraticaId, String[] esiti, int start, int end,
OrderByComparator orderByComparator) throws SystemException {
public List<Asseverazione> findByIntPratica_InEsito(long intPraticaId, String[] esiti, int start,
int end, OrderByComparator orderByComparator) throws SystemException {
return asseverazioneLocalService.findByIntPratica_InEsito(intPraticaId, esiti, start, end, orderByComparator);
}
return asseverazioneLocalService.findByIntPratica_InEsito(intPraticaId, esiti, start, end,
orderByComparator);
}
public int countByIntPratica_InEsito(long intPraticaId, String[] esiti) throws SystemException {
public int countByIntPratica_InEsito(long intPraticaId, String[] esiti) throws SystemException {
return asseverazioneLocalService.countByIntPratica_InEsito(intPraticaId, esiti);
}
return asseverazioneLocalService.countByIntPratica_InEsito(intPraticaId, esiti);
}
public List<Asseverazione> findByDettPratica_InEsito(long dettPraticaId, String[] esiti, int start, int end,
OrderByComparator orderByComparator) throws SystemException {
public List<Asseverazione> findByDettPratica_InEsito(long dettPraticaId, String[] esiti, int start,
int end, OrderByComparator orderByComparator) throws SystemException {
return asseverazioneLocalService.findByDettPratica_InEsito(dettPraticaId, esiti, start, end, orderByComparator);
}
return asseverazioneLocalService.findByDettPratica_InEsito(dettPraticaId, esiti, start, end,
orderByComparator);
}
public int countByDettPratica_InEsito(long dettPraticaId, String[] esiti) throws SystemException {
public int countByDettPratica_InEsito(long dettPraticaId, String[] esiti) throws SystemException {
return asseverazioneLocalService.countByDettPratica_InEsito(dettPraticaId, esiti);
}
return asseverazioneLocalService.countByDettPratica_InEsito(dettPraticaId, esiti);
}
public List<Asseverazione> findByCodiceFiscale_Tipologia_InEsito(String codiceFiscale, String tipologia,
String[] esiti, int start, int end, OrderByComparator orderByComparator) throws SystemException {
public List<Asseverazione> findByCodiceFiscale_Tipologia_InEsito(String codiceFiscale, String tipologia,
String[] esiti, int start, int end, OrderByComparator orderByComparator) throws SystemException {
return asseverazioneLocalService.findByCodiceFiscale_Tipologia_InEsito(codiceFiscale, tipologia, esiti, start, end,
orderByComparator);
}
return asseverazioneLocalService.findByCodiceFiscale_Tipologia_InEsito(codiceFiscale, tipologia,
esiti, start, end, orderByComparator);
}
public int countByCodiceFiscale_Tipologia_InEsito(String codiceFiscale, String tipologia, String[] esiti)
throws SystemException {
public int countByCodiceFiscale_Tipologia_InEsito(String codiceFiscale, String tipologia, String[] esiti)
throws SystemException {
return asseverazioneLocalService.countByCodiceFiscale_Tipologia_InEsito(codiceFiscale, tipologia, esiti);
}
return asseverazioneLocalService.countByCodiceFiscale_Tipologia_InEsito(codiceFiscale, tipologia,
esiti);
}
public List<Asseverazione> findByIntPratica_CodiceFiscale_Tipologia_InEsito(long intPraticaId, String codiceFiscale,
String tipologia, String[] esiti, int start, int end, OrderByComparator orderByComparator) throws SystemException {
public List<Asseverazione> findByIntPratica_CodiceFiscale_Tipologia_InEsito(long intPraticaId,
String codiceFiscale, String tipologia, String[] esiti, int start, int end,
OrderByComparator orderByComparator) throws SystemException {
return asseverazioneLocalService.findByIntPratica_CodiceFiscale_Tipologia_InEsito(intPraticaId, codiceFiscale,
tipologia, esiti, start, end, orderByComparator);
}
return asseverazioneLocalService.findByIntPratica_CodiceFiscale_Tipologia_InEsito(intPraticaId,
codiceFiscale, tipologia, esiti, start, end, orderByComparator);
}
public int countByIntPratica_CodiceFiscale_Tipologia_InEsito(long intPraticaId, String codiceFiscale,
String tipologia, String[] esiti) throws SystemException {
public int countByIntPratica_CodiceFiscale_Tipologia_InEsito(long intPraticaId, String codiceFiscale,
String tipologia, String[] esiti) throws SystemException {
return asseverazioneLocalService.countByIntPratica_CodiceFiscale_Tipologia_InEsito(intPraticaId, codiceFiscale,
tipologia, esiti);
}
return asseverazioneLocalService.countByIntPratica_CodiceFiscale_Tipologia_InEsito(intPraticaId,
codiceFiscale, tipologia, esiti);
}
public List<Asseverazione> findByIntPratica_Tipologia_InEsito(long intPraticaId, String tipologia, String[] esiti,
int start, int end, OrderByComparator orderByComparator) throws SystemException {
public List<Asseverazione> findByIntPratica_Tipologia_InEsito(long intPraticaId, String tipologia,
String[] esiti, int start, int end, OrderByComparator orderByComparator) throws SystemException {
return asseverazioneLocalService.findByIntPratica_Tipologia_InEsito(intPraticaId, tipologia, esiti, start, end,
orderByComparator);
}
return asseverazioneLocalService.findByIntPratica_Tipologia_InEsito(intPraticaId, tipologia, esiti,
start, end, orderByComparator);
}
public List<Asseverazione> findByDettPratica_Tipologia_InEsito(long dettPraticaId, String tipologia, String[] esiti,
int start, int end, OrderByComparator orderByComparator) throws SystemException {
public List<Asseverazione> findByDettPratica_Tipologia_InEsito(long dettPraticaId, String tipologia,
String[] esiti, int start, int end, OrderByComparator orderByComparator) throws SystemException {
return asseverazioneLocalService.findByDettPratica_Tipologia_InEsito(dettPraticaId, tipologia, esiti, start, end,
orderByComparator);
}
return asseverazioneLocalService.findByDettPratica_Tipologia_InEsito(dettPraticaId, tipologia, esiti,
start, end, orderByComparator);
}
public int countByIntPratica_Tipologia_InEsito(long intPraticaId, String tipologia, String[] esiti)
throws SystemException {
public int countByIntPratica_Tipologia_InEsito(long intPraticaId, String tipologia, String[] esiti)
throws SystemException {
return asseverazioneLocalService.countByIntPratica_Tipologia_InEsito(intPraticaId, tipologia, esiti);
}
return asseverazioneLocalService.countByIntPratica_Tipologia_InEsito(intPraticaId, tipologia, esiti);
}
public int countByDettPratica_Tipologia_InEsito(long dettPraticaId, String tipologia, String[] esiti)
throws SystemException {
public int countByDettPratica_Tipologia_InEsito(long dettPraticaId, String tipologia, String[] esiti)
throws SystemException {
return asseverazioneLocalService.countByDettPratica_Tipologia_InEsito(dettPraticaId, tipologia, esiti);
}
return asseverazioneLocalService
.countByDettPratica_Tipologia_InEsito(dettPraticaId, tipologia, esiti);
}
}

11
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/DettPraticaLocalServiceImpl.java

@ -1630,13 +1630,13 @@ public class DettPraticaLocalServiceImpl extends DettPraticaLocalServiceBaseImpl
}
public void updateEsitoPagamento(long pagamentoId, long dettPraticaId, String stato)
throws SystemException, PortalException {
throws IOException, SystemException, PortalException {
updateEsitoPagamento(pagamentoId, dettPraticaId, 0l, stato);
}
public void updateEsitoPagamento(long pagamentoId, long dettPraticaId, long fileEntryId, String stato)
throws SystemException, PortalException {
throws IOException, SystemException, PortalException {
Date now = new Date();
DettPratica dettPratica = dettPraticaPersistence.fetchByPrimaryKey(dettPraticaId);
@ -1700,7 +1700,8 @@ public class DettPraticaLocalServiceImpl extends DettPraticaLocalServiceBaseImpl
}
public DettPratica updateEsito(long dettPraticaId, int stato) throws SystemException, PortalException {
public DettPratica updateEsito(long dettPraticaId, int stato) throws IOException, SystemException,
PortalException {
boolean sendMail = false;
@ -1822,8 +1823,8 @@ public class DettPraticaLocalServiceImpl extends DettPraticaLocalServiceBaseImpl
serviceContext);
}
public DettPratica updateEsitoIntegrazione(long dettPraticaId, int stato) throws SystemException,
PortalException {
public DettPratica updateEsitoIntegrazione(long dettPraticaId, int stato) throws IOException,
SystemException, PortalException {
DettPratica dettPratica = updateEsito(dettPraticaId, stato);
long intPraticaId = dettPratica.getIntPraticaId();

880
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/util/PagamentiUtil.java

@ -26,6 +26,7 @@ import it.tref.liferay.portos.bo.shared.util.PagamentoConstants;
import it.tref.liferay.portos.bo.shared.util.TipoIntegrazioneUtil;
import it.tref.liferay.portos.bo.shared.util.TipoSoggettoUtil;
import java.io.IOException;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Calendar;
@ -46,432 +47,455 @@ import com.liferay.portal.service.ServiceContext;
public abstract class PagamentiUtil {
private static final Log _log = LogFactoryUtil.getLog(PagamentiUtil.class);
public static void verificaPagamentoIRIS(Pagamento pagamento) throws SystemException, PortalException {
// long companyId = pagamento.getCompanyId();
// long groupId = pagamento.getGroupId();
//
// InformazioniPagamentoType[] statoPagamentiType =
// IrisVerificaPagamenti
// .verificaPagamenti(companyId, groupId, pagamento.getCodice(), pagamento.getTipoPagamento());
// List<InformazioniPagamentoType> infoPagamentoTypes =
// IrisVerificaPagamenti
// .verificaPagamenti(companyId, groupId, pagamento.getCodice(), pagamento.getTipoPagamento());
// String statoPagamento = StringPool.BLANK;
// if (infoPagamentoTypes != null) {
// InformazioniPagamentoType infoPagamentoType = infoPagamentoTypes.get(0);
// if
// (infoPagamentoType.getStato().equals(VerificaStatoPagamentoDettagliato.POSIZIONE_NON_PRESENTE))
// {
// // "Posizione non presente" -> si riprova successivamente
// return;
// } else if
// (infoPagamentoType.getStato().equals(VerificaStatoPagamentoDettagliato.POSIZIONE_NON_PAGABILE))
// {
// // "Posizione non pagabile" -> esito negativo
// statoPagamento = PagamentoConstants.UTILIZZATA_NON_PAGABILE;
// } else if
// (infoPagamentoType.getStato().equals(VerificaStatoPagamentoDettagliato.POSIZIONE_NON_PAGATA))
// {
// // "Pagamento non eseguito" -> esito negativo
// statoPagamento = PagamentoConstants.UTILIZZATA_RIFIUTATA;
// } else if
// (infoPagamentoType.getStato().equals(VerificaStatoPagamentoDettagliato.POSIZIONE_CON_PAG_IN_CORSO))
// {
// // "Pagamento non eseguito" -> esito in corso
// statoPagamento = PagamentoConstants.UTILIZZATA_IN_CORSO;
// return;
// } else if
// (infoPagamentoType.getStato().equals(VerificaStatoPagamentoDettagliato.POSIZIONE_PAGATA)
// ||
// infoPagamentoType.getStato().equals(VerificaStatoPagamentoDettagliato.POSIZIONE_PAGATA_SBF))
// {
// // "Pagamento eseguito" -> esito positivo
// statoPagamento = PagamentoConstants.UTILIZZATA_PAGATA;
// }
// String statoPagamento = StringPool.BLANK;
// if (statoPagamentiType != null) {
// InformazioniPagamentoType statoPagamentoType = statoPagamentiType[0];
// String statoPendenza = statoPagamentoType.getStato().getValue();
//
// if (statoPendenza.equals(VerificaStatoPagamentoDettagliato._POSIZIONE_NON_PAGATA)) {
// if (statoPagamentoType.getDescrizioneStato().equalsIgnoreCase(
// VerificaStatoPagamentoDettagliato._POSIZIONE_NON_PAGATA)) {
// // "Posizione non presente" -> si riprova successivamente
// return;
// } else if (statoPagamentoType.getDescrizioneStato().equalsIgnoreCase("PAG_NON_ESEGUITO")) {
// statoPagamento = PagamentoConstants.UTILIZZATA_RIFIUTATA;
// }
// } else if (statoPendenza.equals(VerificaStatoPagamentoDettagliato._POSIZIONE_NON_PAGABILE)) {
// // "Posizione non pagabile" -> esito negativo
// statoPagamento = PagamentoConstants.UTILIZZATA_NON_PAGABILE;
// // } else if (statoPendenza.equals(StatoPagamentoType._value3)) {
// // "Pagamento non ancora eseguito" -> si riprova successivamente
// // if (!pagamento.getOtf()) {
// // return;
// // }
// // "Pagamento non eseguito" -> esito negativo
// // statoPagamento = PagamentoConstants.UTILIZZATA_RIFIUTATA;
// } else if (statoPendenza.equals(VerificaStatoPagamentoDettagliato._POSIZIONE_PAGATA)
// || statoPendenza.equals(VerificaStatoPagamentoDettagliato._POSIZIONE_PAGATA_SBF)) {
// // "Pagamento eseguito" -> esito positivo
// statoPagamento = PagamentoConstants.UTILIZZATA_PAGATA;
// } else if
// (statoPendenza.equals(VerificaStatoPagamentoDettagliato.POSIZIONE_CON_PAG_IN_CORSO)) {
// // "Pagamento non eseguito" -> esito in corso
// statoPagamento = PagamentoConstants.UTILIZZATA_IN_CORSO;
// return;
// }
// StatoPagamentoType statoPagamentoType = statoPagamentiType[0];
// if (statoPagamentoType.enumValue().equals(VerificaStatoPagamento.POSIZIONE_NON_PRESENTE)) {
// // "Posizione non presente" -> si riprova successivamente
// return;
// } else if
// (statoPagamentoType.enumValue().equals(VerificaStatoPagamento.POSIZIONE_NON_PAGABILE)) {
// // "Posizione non pagabile" -> esito negativo
// statoPagamento = PagamentoConstants.UTILIZZATA_NON_PAGABILE;
// } else if
// (statoPagamentoType.enumValue().equals(VerificaStatoPagamento.PAGAMENTO_NON_ESEGUITO)) {
// // "Pagamento non ancora eseguito" -> si riprova successivamente
// if (!pagamento.getOtf()) {
// return;
// }
// // "Pagamento non eseguito" -> esito negativo
// statoPagamento = PagamentoConstants.UTILIZZATA_RIFIUTATA;
// } else if
// (statoPagamentoType.enumValue().equals(VerificaStatoPagamento.POSIZIONE_NON_PAGABILE)) {
// // "Pagamento eseguito" -> esito positivo
// statoPagamento = PagamentoConstants.UTILIZZATA_PAGATA;
// }
// if (DettPratica.class.getName().equals(pagamento.getClassName())) {
// DettPraticaLocalServiceUtil.updateEsitoPagamento(pagamento.getPagamentoId(),
// pagamento.getClassPk(),
// statoPagamento);
// } else if (FineLavori.class.getName().equals(pagamento.getClassName())) {
// FineLavoriLocalServiceUtil.updateEsitoPagamento(pagamento.getPagamentoId(),
// pagamento.getClassPk(),
// statoPagamento);
// } else if (Collaudo.class.getName().equals(pagamento.getClassName())) {
// CollaudoLocalServiceUtil.updateEsitoPagamento(pagamento.getPagamentoId(),
// pagamento.getClassPk(),
// statoPagamento);
// } else {
// throw new RuntimeException("unable to update pagamento esito for entity type " +
// pagamento.getClassName()
// + " with id " + pagamento.getClassPk());
// }
//
// }
String statoPagamento = callVerificaPagamenti(pagamento);
if (Validator.isNotNull(statoPagamento)) {
if (DettPratica.class.getName().equals(pagamento.getClassName())) {
DettPraticaLocalServiceUtil.updateEsitoPagamento(pagamento.getPagamentoId(), pagamento.getClassPk(),
statoPagamento);
} else if (FineLavori.class.getName().equals(pagamento.getClassName())) {
FineLavoriLocalServiceUtil.updateEsitoPagamento(pagamento.getPagamentoId(), pagamento.getClassPk(),
statoPagamento);
} else if (Collaudo.class.getName().equals(pagamento.getClassName())) {
CollaudoLocalServiceUtil.updateEsitoPagamento(pagamento.getPagamentoId(), pagamento.getClassPk(),
statoPagamento);
} else {
throw new RuntimeException("unable to update pagamento esito for entity type " + pagamento.getClassName()
+ " with id " + pagamento.getClassPk());
}
}
}
private static String callVerificaPagamenti(Pagamento pagamento) throws SystemException {
long companyId = pagamento.getCompanyId();
long groupId = pagamento.getGroupId();
if (PagamentoConstants.PAGAMENTO_ONERI.equals(pagamento.getTipoPagamento())) {
InformazioniPagamentoType[] statoPagamentiType =
IrisVerificaPagamenti.verificaPagamenti(companyId, groupId, pagamento.getCodice(),
pagamento.getTipoPagamento());
return checkStatoPagamento(statoPagamentiType);
} else if (PagamentoConstants.PAGAMENTO_BOLLI.equals(pagamento.getTipoPagamento())) {
List<IUV> iuvs = IUVLocalServiceUtil.findByPagamento(pagamento.getPagamentoId());
List<String> statiPagamento = new ArrayList<String>();
for (IUV iuv : iuvs) {
InformazioniPagamentoType[] statoPagamentiType =
IrisVerificaPagamenti.verificaPagamenti(companyId, groupId, iuv.getCodice(), pagamento.getTipoPagamento());
GenericUtils.addIfnotExist(statiPagamento, checkStatoPagamento(statoPagamentiType));
}
if (statiPagamento.size() > 1) {
// return VerificaStatoPagamentoDettagliato._POSIZIONE_CON_PAG_IN_CORSO;
return StringPool.BLANK;
}
return statiPagamento.get(0);
}
throw new SystemException("error.geniocivile.tipopagamento.notexist");
}
private static String checkStatoPagamento(InformazioniPagamentoType[] statoPagamentiType) {
if (statoPagamentiType == null) {
return null;
}
InformazioniPagamentoType statoPagamentoType = statoPagamentiType[0];
String statoPendenza = statoPagamentoType.getStato().getValue();
String statoPagamento = StringPool.BLANK;
if (statoPendenza.equals(VerificaStatoPagamentoDettagliato._POSIZIONE_NON_PAGATA)) {
if (statoPagamentoType.getDescrizioneStato().equalsIgnoreCase(
VerificaStatoPagamentoDettagliato._POSIZIONE_NON_PAGATA)) {
// "Posizione non presente" -> si riprova successivamente
return StringPool.BLANK;
} else if (statoPagamentoType.getDescrizioneStato().equalsIgnoreCase("PAG_NON_ESEGUITO")) {
statoPagamento = PagamentoConstants.UTILIZZATA_RIFIUTATA;
} else if (statoPagamentoType.getDescrizioneStato().equalsIgnoreCase("PAG_IN_ERRORE")) {
statoPagamento = PagamentoConstants.UTILIZZATA_NON_PAGABILE;
}
_log.debug(statoPagamento);
} else if (statoPendenza.equals(VerificaStatoPagamentoDettagliato._POSIZIONE_NON_PAGABILE)) {
// "Posizione non pagabile" -> esito negativo
statoPagamento = PagamentoConstants.UTILIZZATA_NON_PAGABILE;
// } else if (statoPendenza.equals(StatoPagamentoType._value3)) {
// "Pagamento non ancora eseguito" -> si riprova successivamente
// if (!pagamento.getOtf()) {
// return;
// }
// "Pagamento non eseguito" -> esito negativo
// statoPagamento = PagamentoConstants.UTILIZZATA_RIFIUTATA;
_log.debug(statoPagamento);
} else if (statoPendenza.equals(VerificaStatoPagamentoDettagliato._POSIZIONE_PAGATA)
|| statoPendenza.equals(VerificaStatoPagamentoDettagliato._POSIZIONE_PAGATA_SBF)) {
// "Pagamento eseguito" -> esito positivo
statoPagamento = PagamentoConstants.UTILIZZATA_PAGATA;
_log.debug(statoPagamento);
} else if (statoPendenza.equalsIgnoreCase(VerificaStatoPagamentoDettagliato._POSIZIONE_CON_PAG_IN_CORSO)) {
// "Pagamento non eseguito" -> esito in corso
statoPagamento = PagamentoConstants.UTILIZZATA_IN_CORSO;
return StringPool.BLANK;
}
return statoPagamento;
}
public static BigDecimal getImportoBolli(long companyId, long dettPraticaId, String tipoIntegrazione)
throws PortalException, SystemException {
return PagamentiCommonUtil.getImportoBolli(companyId, dettPraticaId, DettPratica.class.getName(), tipoIntegrazione);
}
public static Date getScadenzaPending() {
Calendar calendar = CalendarFactoryUtil.getCalendar();
calendar.add(Calendar.MINUTE, -30);
return calendar.getTime();
}
public static boolean isPagamentoScadutoInPending(Pagamento pagamento) {
return pagamento.getCreateDate().compareTo(getScadenzaPending()) < 0;
}
public static Pagamento nuovoPagamento(String currentURL, long classPk, String className, String tipoPagamento,
String importo, String codiceFiscaleCommittente, ServiceContext serviceContext) throws PortalException,
SystemException {
boolean irisDisabled = !PagamentiCommonUtil.irisIsEnable(serviceContext.getCompanyId());
boolean esenzioneBolli = false;
boolean esenzioneSpeseIstruttoria = false;
String tipoIntegrazione = StringPool.BLANK;
long pagamentoId = 0l;
long intPraticaId = 0l;
// long dettPraticaId = 0l;
if (DettPratica.class.getName().equals(className)) {
DettPratica dettPratica = DettPraticaLocalServiceUtil.getDettPratica(classPk);
esenzioneBolli = dettPratica.isNormEsenteBollo();
esenzioneSpeseIstruttoria = dettPratica.isNormEsenteSpese();
tipoIntegrazione = dettPratica.getTipoIntegrazione();
if (PagamentoConstants.PAGAMENTO_ONERI.equals(tipoPagamento)) {
pagamentoId = dettPratica.getPagamentoIdOneri();
} else if (PagamentoConstants.PAGAMENTO_BOLLI.equals(tipoPagamento)) {
pagamentoId = dettPratica.getPagamentoIdBolli();
}
intPraticaId = dettPratica.getIntPraticaId();
// dettPraticaId = classPk;
} else if (FineLavori.class.getName().equals(className)) {
FineLavori fineLavori = FineLavoriLocalServiceUtil.getFineLavori(classPk);
esenzioneBolli = fineLavori.isNormEsenteBollo();
esenzioneSpeseIstruttoria = true;
tipoIntegrazione = TipoIntegrazioneUtil.FINE_LAVORI;
if (PagamentoConstants.PAGAMENTO_ONERI.equals(tipoPagamento)) {
throw new SystemException("error.fields.fineLavori.pagamento.classPk.invalid");
} else if (PagamentoConstants.PAGAMENTO_BOLLI.equals(tipoPagamento)) {
pagamentoId = fineLavori.getPagamentoId();
}
// dettPraticaId =
// DettPraticaLocalServiceUtil.getLastCompletedByIntPratica(fineLavori.getIntPraticaId()).getDettPraticaId();
intPraticaId = fineLavori.getIntPraticaId();
} else if (Collaudo.class.getName().equals(className)) {
Collaudo collaudo = CollaudoLocalServiceUtil.getCollaudo(classPk);
esenzioneBolli = collaudo.isNormEsenteBollo();
esenzioneSpeseIstruttoria = true;
tipoIntegrazione = TipoIntegrazioneUtil.COLLAUDO;
if (PagamentoConstants.PAGAMENTO_ONERI.equals(tipoPagamento)) {
throw new SystemException("error.fields.collaudo.pagamento.classPk.invalid");
} else if (PagamentoConstants.PAGAMENTO_BOLLI.equals(tipoPagamento)) {
pagamentoId = collaudo.getPagamentoId();
}
// dettPraticaId =
// DettPraticaLocalServiceUtil.getLastCompletedByIntPratica(collaudo.getIntPraticaId()).getDettPraticaId();
intPraticaId = collaudo.getIntPraticaId();
} else {
throw new SystemException("error.fields.pratica.pagamento.classPk.invalid");
}
List<String> importi = new ArrayList<>();
if (esenzioneSpeseIstruttoria && esenzioneBolli) {
throw new SystemException("error.fields.pratica.pagamento.esente.oneri.bolli");
} else {
if ((PagamentoConstants.PAGAMENTO_BOLLI.equals(tipoPagamento) && !esenzioneBolli)
|| (PagamentoConstants.PAGAMENTO_ONERI.equals(tipoPagamento) && !esenzioneSpeseIstruttoria)) {
if (Validator.isNotNull(importo)) {
importo = importo.replaceAll(StringPool.COMMA, StringPool.PERIOD);
try {
BigDecimal importoVal = new BigDecimal(importo);
importo = importoVal.toPlainString();
if (PagamentoConstants.PAGAMENTO_BOLLI.equals(tipoPagamento)) {
int numeroBolli = PagamentiCommonUtil.getNumeroBolli(tipoIntegrazione);
BigDecimal singoloImporto = importoVal.divide(new BigDecimal(numeroBolli));
for (int i = 0; i < numeroBolli; i++) {
importi.add(singoloImporto.toPlainString());
}
} else if (PagamentoConstants.PAGAMENTO_ONERI.equals(tipoPagamento)) {
importi.add(importo);
}
} catch (NumberFormatException e) {
throw new SystemException("error.fields.pratica.pagamento."
+ (PagamentoConstants.PAGAMENTO_BOLLI.equals(tipoPagamento) ? "bolli" : "speseistruttoria") + ".valid",
e);
}
} else {
if (PagamentoConstants.PAGAMENTO_BOLLI.equals(tipoPagamento)
|| PagamentiCommonUtil.existsSpeseIstruttoria(tipoIntegrazione)) {
throw new SystemException("error.fields.pratica.pagamento."
+ (PagamentoConstants.PAGAMENTO_BOLLI.equals(tipoPagamento) ? "bolli" : "speseistruttoria")
+ ".required");
}
}
} else {
return null;
}
}
if (!irisDisabled) {
if (Validator.isNull(pagamentoId)) {
Soggetto committente =
SoggettoLocalServiceUtil.getValidTmpByIntPratica_CodiceFiscale_TipologiaSoggetto(intPraticaId,
codiceFiscaleCommittente, TipoSoggettoUtil.COMMITTENTE);
String provincia = StringPool.BLANK;
String codiceProvincia = committente.getProvincia();
if (codiceProvincia.equalsIgnoreCase("ee")) {
provincia = "EE";
} else {
Provincia provinciaEntity =
ProvinciaLocalServiceUtil.fetchByC_C(serviceContext.getCompanyId(), codiceProvincia);
if (Validator.isNotNull(provinciaEntity)) {
provincia = provinciaEntity.getSigla();
}
}
String codice = IrisCommonUtil.createCodicePendenza();
String causale = IrisCommonUtil.getDescrizioneCausale(tipoPagamento);
long irisPagamentoId = PagamentoLocalServiceUtil.createPagamentoId();
currentURL = StringUtil.replaceLast(currentURL, "/0", StringPool.SLASH + irisPagamentoId);
String auth = HttpUtil.getParameter(currentURL, "p_auth", false);
// XXX Se non li rimuovi non funziona più
Map<String, String[]> parameters = HttpUtil.getParameterMap(HttpUtil.getQueryString(currentURL));
for (String key : parameters.keySet()) {
currentURL = HttpUtil.removeParameter(currentURL, key);
}
if (Validator.isNotNull(auth)) {
currentURL = HttpUtil.addParameter(currentURL, "p_auth", auth);
}
if (Validator.isNull(codiceFiscaleCommittente)) {
throw new SystemException("error.fields.pratica.pagamento.codicefiscale.richiesto");
}
List<ElencoIdentificativiType> iuvs = new ArrayList<ElencoIdentificativiType>();
if (PagamentoConstants.PAGAMENTO_BOLLI.equalsIgnoreCase(tipoPagamento)) {
iuvs = IrisComunicaPosizioniDebitorie.generaIUV(serviceContext.getCompanyId(), importi.size());
}
IdpOTFType idpOTFType =
IrisComunicaPosizioniDebitorie.comunicaPosizioniDebitorieOTF(serviceContext.getCompanyId(),
serviceContext.getScopeGroupId(), serviceContext.getUserId(), codice, causale,
codiceFiscaleCommittente, tipoPagamento, importi, iuvs, currentURL, currentURL, provincia);
String urlPagamento = "";
if (idpOTFType == null) {
urlPagamento = currentURL;
throw new SystemException("error.geniocivilefe.pratica.pagamento | intPraticaId=" + intPraticaId
+ " | classPk=" + classPk + " | className=" + className);
} else {
urlPagamento = idpOTFType.getUrlGW().toString();
}
return PagamentoLocalServiceUtil.addPagamentoAndUpdate(irisPagamentoId, codice, causale,
PagamentoConstants.MEZZO_IRIS, codiceFiscaleCommittente, tipoPagamento, importo,
PagamentoConstants.UTILIZZATA_IN_CORSO, classPk, className, 0l, urlPagamento, iuvs, serviceContext);
// actionResponse.sendRedirect(idpOTFType.getUrlGW().toString());
} else {
return PagamentoLocalServiceUtil.getPagamento(pagamentoId);
}
// }
} else {
boolean add = true;
if (Validator.isNotNull(pagamentoId)) {
Pagamento pagamento = PagamentoLocalServiceUtil.getPagamento(pagamentoId);
if (pagamento.getClassPk() == classPk) {
add = false;
PagamentoLocalServiceUtil.updatePagamento(pagamentoId, codiceFiscaleCommittente, importo);
}
return pagamento;
}
if (add) {
return PagamentoLocalServiceUtil.addPagamentoAndUpdate(StringPool.BLANK, StringPool.BLANK,
PagamentoConstants.MEZZO_MANUALE, codiceFiscaleCommittente, tipoPagamento, importo,
PagamentoConstants.UTILIZZATA_IN_CORSO, classPk, className, 0l, serviceContext);
}
return null;
}
}
private static final Log _log = LogFactoryUtil.getLog(PagamentiUtil.class);
public static void verificaPagamentoIRIS(Pagamento pagamento) throws IOException, SystemException,
PortalException {
// long companyId = pagamento.getCompanyId();
// long groupId = pagamento.getGroupId();
//
// InformazioniPagamentoType[] statoPagamentiType =
// IrisVerificaPagamenti
// .verificaPagamenti(companyId, groupId, pagamento.getCodice(),
// pagamento.getTipoPagamento());
// List<InformazioniPagamentoType> infoPagamentoTypes =
// IrisVerificaPagamenti
// .verificaPagamenti(companyId, groupId, pagamento.getCodice(),
// pagamento.getTipoPagamento());
// String statoPagamento = StringPool.BLANK;
// if (infoPagamentoTypes != null) {
// InformazioniPagamentoType infoPagamentoType =
// infoPagamentoTypes.get(0);
// if
// (infoPagamentoType.getStato().equals(VerificaStatoPagamentoDettagliato.POSIZIONE_NON_PRESENTE))
// {
// // "Posizione non presente" -> si riprova successivamente
// return;
// } else if
// (infoPagamentoType.getStato().equals(VerificaStatoPagamentoDettagliato.POSIZIONE_NON_PAGABILE))
// {
// // "Posizione non pagabile" -> esito negativo
// statoPagamento = PagamentoConstants.UTILIZZATA_NON_PAGABILE;
// } else if
// (infoPagamentoType.getStato().equals(VerificaStatoPagamentoDettagliato.POSIZIONE_NON_PAGATA))
// {
// // "Pagamento non eseguito" -> esito negativo
// statoPagamento = PagamentoConstants.UTILIZZATA_RIFIUTATA;
// } else if
// (infoPagamentoType.getStato().equals(VerificaStatoPagamentoDettagliato.POSIZIONE_CON_PAG_IN_CORSO))
// {
// // "Pagamento non eseguito" -> esito in corso
// statoPagamento = PagamentoConstants.UTILIZZATA_IN_CORSO;
// return;
// } else if
// (infoPagamentoType.getStato().equals(VerificaStatoPagamentoDettagliato.POSIZIONE_PAGATA)
// ||
// infoPagamentoType.getStato().equals(VerificaStatoPagamentoDettagliato.POSIZIONE_PAGATA_SBF))
// {
// // "Pagamento eseguito" -> esito positivo
// statoPagamento = PagamentoConstants.UTILIZZATA_PAGATA;
// }
// String statoPagamento = StringPool.BLANK;
// if (statoPagamentiType != null) {
// InformazioniPagamentoType statoPagamentoType = statoPagamentiType[0];
// String statoPendenza = statoPagamentoType.getStato().getValue();
//
// if
// (statoPendenza.equals(VerificaStatoPagamentoDettagliato._POSIZIONE_NON_PAGATA))
// {
// if (statoPagamentoType.getDescrizioneStato().equalsIgnoreCase(
// VerificaStatoPagamentoDettagliato._POSIZIONE_NON_PAGATA)) {
// // "Posizione non presente" -> si riprova successivamente
// return;
// } else if
// (statoPagamentoType.getDescrizioneStato().equalsIgnoreCase("PAG_NON_ESEGUITO"))
// {
// statoPagamento = PagamentoConstants.UTILIZZATA_RIFIUTATA;
// }
// } else if
// (statoPendenza.equals(VerificaStatoPagamentoDettagliato._POSIZIONE_NON_PAGABILE))
// {
// // "Posizione non pagabile" -> esito negativo
// statoPagamento = PagamentoConstants.UTILIZZATA_NON_PAGABILE;
// // } else if (statoPendenza.equals(StatoPagamentoType._value3)) {
// // "Pagamento non ancora eseguito" -> si riprova successivamente
// // if (!pagamento.getOtf()) {
// // return;
// // }
// // "Pagamento non eseguito" -> esito negativo
// // statoPagamento = PagamentoConstants.UTILIZZATA_RIFIUTATA;
// } else if
// (statoPendenza.equals(VerificaStatoPagamentoDettagliato._POSIZIONE_PAGATA)
// ||
// statoPendenza.equals(VerificaStatoPagamentoDettagliato._POSIZIONE_PAGATA_SBF))
// {
// // "Pagamento eseguito" -> esito positivo
// statoPagamento = PagamentoConstants.UTILIZZATA_PAGATA;
// } else if
// (statoPendenza.equals(VerificaStatoPagamentoDettagliato.POSIZIONE_CON_PAG_IN_CORSO))
// {
// // "Pagamento non eseguito" -> esito in corso
// statoPagamento = PagamentoConstants.UTILIZZATA_IN_CORSO;
// return;
// }
// StatoPagamentoType statoPagamentoType = statoPagamentiType[0];
// if
// (statoPagamentoType.enumValue().equals(VerificaStatoPagamento.POSIZIONE_NON_PRESENTE))
// {
// // "Posizione non presente" -> si riprova successivamente
// return;
// } else if
// (statoPagamentoType.enumValue().equals(VerificaStatoPagamento.POSIZIONE_NON_PAGABILE))
// {
// // "Posizione non pagabile" -> esito negativo
// statoPagamento = PagamentoConstants.UTILIZZATA_NON_PAGABILE;
// } else if
// (statoPagamentoType.enumValue().equals(VerificaStatoPagamento.PAGAMENTO_NON_ESEGUITO))
// {
// // "Pagamento non ancora eseguito" -> si riprova successivamente
// if (!pagamento.getOtf()) {
// return;
// }
// // "Pagamento non eseguito" -> esito negativo
// statoPagamento = PagamentoConstants.UTILIZZATA_RIFIUTATA;
// } else if
// (statoPagamentoType.enumValue().equals(VerificaStatoPagamento.POSIZIONE_NON_PAGABILE))
// {
// // "Pagamento eseguito" -> esito positivo
// statoPagamento = PagamentoConstants.UTILIZZATA_PAGATA;
// }
// if (DettPratica.class.getName().equals(pagamento.getClassName())) {
// DettPraticaLocalServiceUtil.updateEsitoPagamento(pagamento.getPagamentoId(),
// pagamento.getClassPk(),
// statoPagamento);
// } else if
// (FineLavori.class.getName().equals(pagamento.getClassName())) {
// FineLavoriLocalServiceUtil.updateEsitoPagamento(pagamento.getPagamentoId(),
// pagamento.getClassPk(),
// statoPagamento);
// } else if (Collaudo.class.getName().equals(pagamento.getClassName()))
// {
// CollaudoLocalServiceUtil.updateEsitoPagamento(pagamento.getPagamentoId(),
// pagamento.getClassPk(),
// statoPagamento);
// } else {
// throw new
// RuntimeException("unable to update pagamento esito for entity type "
// +
// pagamento.getClassName()
// + " with id " + pagamento.getClassPk());
// }
//
// }
String statoPagamento = callVerificaPagamenti(pagamento);
if (Validator.isNotNull(statoPagamento)) {
if (DettPratica.class.getName().equals(pagamento.getClassName())) {
DettPraticaLocalServiceUtil.updateEsitoPagamento(pagamento.getPagamentoId(),
pagamento.getClassPk(), statoPagamento);
} else if (FineLavori.class.getName().equals(pagamento.getClassName())) {
FineLavoriLocalServiceUtil.updateEsitoPagamento(pagamento.getPagamentoId(),
pagamento.getClassPk(), statoPagamento);
} else if (Collaudo.class.getName().equals(pagamento.getClassName())) {
CollaudoLocalServiceUtil.updateEsitoPagamento(pagamento.getPagamentoId(),
pagamento.getClassPk(), statoPagamento);
} else {
throw new RuntimeException("unable to update pagamento esito for entity type "
+ pagamento.getClassName() + " with id " + pagamento.getClassPk());
}
}
}
private static String callVerificaPagamenti(Pagamento pagamento) throws SystemException {
long companyId = pagamento.getCompanyId();
long groupId = pagamento.getGroupId();
if (PagamentoConstants.PAGAMENTO_ONERI.equals(pagamento.getTipoPagamento())) {
InformazioniPagamentoType[] statoPagamentiType = IrisVerificaPagamenti.verificaPagamenti(
companyId, groupId, pagamento.getCodice(), pagamento.getTipoPagamento());
return checkStatoPagamento(statoPagamentiType);
} else if (PagamentoConstants.PAGAMENTO_BOLLI.equals(pagamento.getTipoPagamento())) {
List<IUV> iuvs = IUVLocalServiceUtil.findByPagamento(pagamento.getPagamentoId());
List<String> statiPagamento = new ArrayList<String>();
for (IUV iuv : iuvs) {
InformazioniPagamentoType[] statoPagamentiType = IrisVerificaPagamenti.verificaPagamenti(
companyId, groupId, iuv.getCodice(), pagamento.getTipoPagamento());
GenericUtils.addIfnotExist(statiPagamento, checkStatoPagamento(statoPagamentiType));
}
if (statiPagamento.size() > 1) {
// return
// VerificaStatoPagamentoDettagliato._POSIZIONE_CON_PAG_IN_CORSO;
return StringPool.BLANK;
}
return statiPagamento.get(0);
}
throw new SystemException("error.geniocivile.tipopagamento.notexist");
}
private static String checkStatoPagamento(InformazioniPagamentoType[] statoPagamentiType) {
if (statoPagamentiType == null) {
return null;
}
InformazioniPagamentoType statoPagamentoType = statoPagamentiType[0];
String statoPendenza = statoPagamentoType.getStato().getValue();
String statoPagamento = StringPool.BLANK;
if (statoPendenza.equals(VerificaStatoPagamentoDettagliato._POSIZIONE_NON_PAGATA)) {
if (statoPagamentoType.getDescrizioneStato().equalsIgnoreCase(
VerificaStatoPagamentoDettagliato._POSIZIONE_NON_PAGATA)) {
// "Posizione non presente" -> si riprova successivamente
return StringPool.BLANK;
} else if (statoPagamentoType.getDescrizioneStato().equalsIgnoreCase("PAG_NON_ESEGUITO")) {
statoPagamento = PagamentoConstants.UTILIZZATA_RIFIUTATA;
} else if (statoPagamentoType.getDescrizioneStato().equalsIgnoreCase("PAG_IN_ERRORE")) {
statoPagamento = PagamentoConstants.UTILIZZATA_NON_PAGABILE;
}
_log.debug(statoPagamento);
} else if (statoPendenza.equals(VerificaStatoPagamentoDettagliato._POSIZIONE_NON_PAGABILE)) {
// "Posizione non pagabile" -> esito negativo
statoPagamento = PagamentoConstants.UTILIZZATA_NON_PAGABILE;
// } else if (statoPendenza.equals(StatoPagamentoType._value3)) {
// "Pagamento non ancora eseguito" -> si riprova successivamente
// if (!pagamento.getOtf()) {
// return;
// }
// "Pagamento non eseguito" -> esito negativo
// statoPagamento = PagamentoConstants.UTILIZZATA_RIFIUTATA;
_log.debug(statoPagamento);
} else if (statoPendenza.equals(VerificaStatoPagamentoDettagliato._POSIZIONE_PAGATA)
|| statoPendenza.equals(VerificaStatoPagamentoDettagliato._POSIZIONE_PAGATA_SBF)) {
// "Pagamento eseguito" -> esito positivo
statoPagamento = PagamentoConstants.UTILIZZATA_PAGATA;
_log.debug(statoPagamento);
} else if (statoPendenza
.equalsIgnoreCase(VerificaStatoPagamentoDettagliato._POSIZIONE_CON_PAG_IN_CORSO)) {
// "Pagamento non eseguito" -> esito in corso
statoPagamento = PagamentoConstants.UTILIZZATA_IN_CORSO;
return StringPool.BLANK;
}
return statoPagamento;
}
public static BigDecimal getImportoBolli(long companyId, long dettPraticaId, String tipoIntegrazione)
throws PortalException, SystemException {
return PagamentiCommonUtil.getImportoBolli(companyId, dettPraticaId, DettPratica.class.getName(),
tipoIntegrazione);
}
public static Date getScadenzaPending() {
Calendar calendar = CalendarFactoryUtil.getCalendar();
calendar.add(Calendar.MINUTE, -30);
return calendar.getTime();
}
public static boolean isPagamentoScadutoInPending(Pagamento pagamento) {
return pagamento.getCreateDate().compareTo(getScadenzaPending()) < 0;
}
public static Pagamento nuovoPagamento(String currentURL, long classPk, String className,
String tipoPagamento, String importo, String codiceFiscaleCommittente,
ServiceContext serviceContext) throws PortalException, SystemException {
boolean irisDisabled = !PagamentiCommonUtil.irisIsEnable(serviceContext.getCompanyId());
boolean esenzioneBolli = false;
boolean esenzioneSpeseIstruttoria = false;
String tipoIntegrazione = StringPool.BLANK;
long pagamentoId = 0l;
long intPraticaId = 0l;
// long dettPraticaId = 0l;
if (DettPratica.class.getName().equals(className)) {
DettPratica dettPratica = DettPraticaLocalServiceUtil.getDettPratica(classPk);
esenzioneBolli = dettPratica.isNormEsenteBollo();
esenzioneSpeseIstruttoria = dettPratica.isNormEsenteSpese();
tipoIntegrazione = dettPratica.getTipoIntegrazione();
if (PagamentoConstants.PAGAMENTO_ONERI.equals(tipoPagamento)) {
pagamentoId = dettPratica.getPagamentoIdOneri();
} else if (PagamentoConstants.PAGAMENTO_BOLLI.equals(tipoPagamento)) {
pagamentoId = dettPratica.getPagamentoIdBolli();
}
intPraticaId = dettPratica.getIntPraticaId();
// dettPraticaId = classPk;
} else if (FineLavori.class.getName().equals(className)) {
FineLavori fineLavori = FineLavoriLocalServiceUtil.getFineLavori(classPk);
esenzioneBolli = fineLavori.isNormEsenteBollo();
esenzioneSpeseIstruttoria = true;
tipoIntegrazione = TipoIntegrazioneUtil.FINE_LAVORI;
if (PagamentoConstants.PAGAMENTO_ONERI.equals(tipoPagamento)) {
throw new SystemException("error.fields.fineLavori.pagamento.classPk.invalid");
} else if (PagamentoConstants.PAGAMENTO_BOLLI.equals(tipoPagamento)) {
pagamentoId = fineLavori.getPagamentoId();
}
// dettPraticaId =
// DettPraticaLocalServiceUtil.getLastCompletedByIntPratica(fineLavori.getIntPraticaId()).getDettPraticaId();
intPraticaId = fineLavori.getIntPraticaId();
} else if (Collaudo.class.getName().equals(className)) {
Collaudo collaudo = CollaudoLocalServiceUtil.getCollaudo(classPk);
esenzioneBolli = collaudo.isNormEsenteBollo();
esenzioneSpeseIstruttoria = true;
tipoIntegrazione = TipoIntegrazioneUtil.COLLAUDO;
if (PagamentoConstants.PAGAMENTO_ONERI.equals(tipoPagamento)) {
throw new SystemException("error.fields.collaudo.pagamento.classPk.invalid");
} else if (PagamentoConstants.PAGAMENTO_BOLLI.equals(tipoPagamento)) {
pagamentoId = collaudo.getPagamentoId();
}
// dettPraticaId =
// DettPraticaLocalServiceUtil.getLastCompletedByIntPratica(collaudo.getIntPraticaId()).getDettPraticaId();
intPraticaId = collaudo.getIntPraticaId();
} else {
throw new SystemException("error.fields.pratica.pagamento.classPk.invalid");
}
List<String> importi = new ArrayList<>();
if (esenzioneSpeseIstruttoria && esenzioneBolli) {
throw new SystemException("error.fields.pratica.pagamento.esente.oneri.bolli");
} else {
if ((PagamentoConstants.PAGAMENTO_BOLLI.equals(tipoPagamento) && !esenzioneBolli)
|| (PagamentoConstants.PAGAMENTO_ONERI.equals(tipoPagamento) && !esenzioneSpeseIstruttoria)) {
if (Validator.isNotNull(importo)) {
importo = importo.replaceAll(StringPool.COMMA, StringPool.PERIOD);
try {
BigDecimal importoVal = new BigDecimal(importo);
importo = importoVal.toPlainString();
if (PagamentoConstants.PAGAMENTO_BOLLI.equals(tipoPagamento)) {
int numeroBolli = PagamentiCommonUtil.getNumeroBolli(tipoIntegrazione);
BigDecimal singoloImporto = importoVal.divide(new BigDecimal(numeroBolli));
for (int i = 0; i < numeroBolli; i++) {
importi.add(singoloImporto.toPlainString());
}
} else if (PagamentoConstants.PAGAMENTO_ONERI.equals(tipoPagamento)) {
importi.add(importo);
}
} catch (NumberFormatException e) {
throw new SystemException("error.fields.pratica.pagamento."
+ (PagamentoConstants.PAGAMENTO_BOLLI.equals(tipoPagamento) ? "bolli"
: "speseistruttoria") + ".valid", e);
}
} else {
if (PagamentoConstants.PAGAMENTO_BOLLI.equals(tipoPagamento)
|| PagamentiCommonUtil.existsSpeseIstruttoria(tipoIntegrazione)) {
throw new SystemException("error.fields.pratica.pagamento."
+ (PagamentoConstants.PAGAMENTO_BOLLI.equals(tipoPagamento) ? "bolli"
: "speseistruttoria") + ".required");
}
}
} else {
return null;
}
}
if (!irisDisabled) {
if (Validator.isNull(pagamentoId)) {
Soggetto committente = SoggettoLocalServiceUtil
.getValidTmpByIntPratica_CodiceFiscale_TipologiaSoggetto(intPraticaId,
codiceFiscaleCommittente, TipoSoggettoUtil.COMMITTENTE);
String provincia = StringPool.BLANK;
String codiceProvincia = committente.getProvincia();
if (codiceProvincia.equalsIgnoreCase("ee")) {
provincia = "EE";
} else {
Provincia provinciaEntity = ProvinciaLocalServiceUtil.fetchByC_C(
serviceContext.getCompanyId(), codiceProvincia);
if (Validator.isNotNull(provinciaEntity)) {
provincia = provinciaEntity.getSigla();
}
}
String codice = IrisCommonUtil.createCodicePendenza();
String causale = IrisCommonUtil.getDescrizioneCausale(tipoPagamento);
long irisPagamentoId = PagamentoLocalServiceUtil.createPagamentoId();
currentURL = StringUtil.replaceLast(currentURL, "/0", StringPool.SLASH + irisPagamentoId);
String auth = HttpUtil.getParameter(currentURL, "p_auth", false);
// XXX Se non li rimuovi non funziona più
Map<String, String[]> parameters = HttpUtil.getParameterMap(HttpUtil
.getQueryString(currentURL));
for (String key : parameters.keySet()) {
currentURL = HttpUtil.removeParameter(currentURL, key);
}
if (Validator.isNotNull(auth)) {
currentURL = HttpUtil.addParameter(currentURL, "p_auth", auth);
}
if (Validator.isNull(codiceFiscaleCommittente)) {
throw new SystemException("error.fields.pratica.pagamento.codicefiscale.richiesto");
}
List<ElencoIdentificativiType> iuvs = new ArrayList<ElencoIdentificativiType>();
if (PagamentoConstants.PAGAMENTO_BOLLI.equalsIgnoreCase(tipoPagamento)) {
iuvs = IrisComunicaPosizioniDebitorie.generaIUV(serviceContext.getCompanyId(),
importi.size());
}
IdpOTFType idpOTFType = IrisComunicaPosizioniDebitorie.comunicaPosizioniDebitorieOTF(
serviceContext.getCompanyId(), serviceContext.getScopeGroupId(),
serviceContext.getUserId(), codice, causale, codiceFiscaleCommittente, tipoPagamento,
importi, iuvs, currentURL, currentURL, provincia);
String urlPagamento = "";
if (idpOTFType == null) {
urlPagamento = currentURL;
throw new SystemException("error.geniocivilefe.pratica.pagamento | intPraticaId="
+ intPraticaId + " | classPk=" + classPk + " | className=" + className);
} else {
urlPagamento = idpOTFType.getUrlGW().toString();
}
return PagamentoLocalServiceUtil.addPagamentoAndUpdate(irisPagamentoId, codice, causale,
PagamentoConstants.MEZZO_IRIS, codiceFiscaleCommittente, tipoPagamento, importo,
PagamentoConstants.UTILIZZATA_IN_CORSO, classPk, className, 0l, urlPagamento, iuvs,
serviceContext);
// actionResponse.sendRedirect(idpOTFType.getUrlGW().toString());
} else {
return PagamentoLocalServiceUtil.getPagamento(pagamentoId);
}
// }
} else {
boolean add = true;
if (Validator.isNotNull(pagamentoId)) {
Pagamento pagamento = PagamentoLocalServiceUtil.getPagamento(pagamentoId);
if (pagamento.getClassPk() == classPk) {
add = false;
PagamentoLocalServiceUtil.updatePagamento(pagamentoId, codiceFiscaleCommittente, importo);
}
return pagamento;
}
if (add) {
return PagamentoLocalServiceUtil.addPagamentoAndUpdate(StringPool.BLANK, StringPool.BLANK,
PagamentoConstants.MEZZO_MANUALE, codiceFiscaleCommittente, tipoPagamento, importo,
PagamentoConstants.UTILIZZATA_IN_CORSO, classPk, className, 0l, serviceContext);
}
return null;
}
}
}

4
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/service.properties

@ -13,8 +13,8 @@
##
build.namespace=portos_bo
build.number=2249
build.date=1589721359115
build.number=2254
build.date=1589897278985
build.auto.upgrade=true
##

Caricamento…
Annulla
Salva