|
|
|
@ -5,6 +5,7 @@ import it.tref.liferay.portos.bo.model.DettPratica;
|
|
|
|
|
import it.tref.liferay.portos.bo.model.IntPratica; |
|
|
|
|
import it.tref.liferay.portos.bo.service.AvvisoLocalServiceUtil; |
|
|
|
|
import it.tref.liferay.portos.bo.service.AvvisoServiceUtil; |
|
|
|
|
import it.tref.liferay.portos.bo.service.ConfigurazioneLocalServiceUtil; |
|
|
|
|
import it.tref.liferay.portos.bo.service.DettPraticaLocalServiceUtil; |
|
|
|
|
import it.tref.liferay.portos.bo.service.IntPraticaLocalServiceUtil; |
|
|
|
|
import it.tref.liferay.portos.bo.service.TerritorioLocalServiceUtil; |
|
|
|
@ -54,46 +55,52 @@ import com.liferay.util.bridges.mvc.MVCPortlet;
|
|
|
|
|
|
|
|
|
|
public class GestioneFirmePortlet extends MVCPortlet { |
|
|
|
|
|
|
|
|
|
public void assignaFirma(ActionRequest actionRequest, ActionResponse actionResponse) throws PortalException, |
|
|
|
|
SystemException { |
|
|
|
|
public void assegnaFirma(ActionRequest request, ActionResponse response) throws PortalException, SystemException { |
|
|
|
|
|
|
|
|
|
ServiceContext serviceContext = ServiceContextFactory.getInstance(actionRequest); |
|
|
|
|
ServiceContext serviceContext = ServiceContextFactory.getInstance(request); |
|
|
|
|
User user = UserLocalServiceUtil.getUser(serviceContext.getUserId()); |
|
|
|
|
long avvisoId = ParamUtil.getLong(actionRequest, "avvisoId"); |
|
|
|
|
long avvisoId = ParamUtil.getLong(request, "avvisoId"); |
|
|
|
|
Avviso avviso = AvvisoLocalServiceUtil.getAvviso(avvisoId); |
|
|
|
|
if (GestioneFirmeUtil.userCanSignAvviso(user.getUserId(), avviso.getGroupId(), avviso.getAvvisoId())) { |
|
|
|
|
AvvisoServiceUtil.assegnaFirma(avviso.getAvvisoId(), user.getScreenName()); |
|
|
|
|
PortalUtil.copyRequestParameters(actionRequest, actionResponse); |
|
|
|
|
PortalUtil.copyRequestParameters(request, response); |
|
|
|
|
} else { |
|
|
|
|
SessionErrors.add(actionRequest, "non possibile asssegnazione firma"); |
|
|
|
|
SessionErrors.add(request, "non possibile asssegnazione firma"); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public void rilasciaFirma(ActionRequest actionRequest, ActionResponse actionResponse) throws PortalException, |
|
|
|
|
SystemException { |
|
|
|
|
public void rilasciaFirma(ActionRequest request, ActionResponse response) throws PortalException, SystemException { |
|
|
|
|
|
|
|
|
|
ServiceContext serviceContext = ServiceContextFactory.getInstance(actionRequest); |
|
|
|
|
ServiceContext serviceContext = ServiceContextFactory.getInstance(request); |
|
|
|
|
User user = UserLocalServiceUtil.getUser(serviceContext.getUserId()); |
|
|
|
|
long avvisoId = ParamUtil.getLong(actionRequest, "avvisoId"); |
|
|
|
|
Avviso avviso = AvvisoLocalServiceUtil.getAvviso(avvisoId); |
|
|
|
|
AvvisoServiceUtil.rilasciaFirma(avviso.getAvvisoId(), user.getScreenName()); |
|
|
|
|
PortalUtil.copyRequestParameters(actionRequest, actionResponse); |
|
|
|
|
long avvisoId = ParamUtil.getLong(request, "avvisoId"); |
|
|
|
|
AvvisoServiceUtil.rilasciaFirma(avvisoId, user.getScreenName()); |
|
|
|
|
PortalUtil.copyRequestParameters(request, response); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public void simulaFirma(ActionRequest request, ActionResponse response) throws Exception { |
|
|
|
|
|
|
|
|
|
ServiceContext serviceContext = ServiceContextFactory.getInstance(request); |
|
|
|
|
if (ConfigurazioneLocalServiceUtil.isDeveloper(serviceContext.getUserId())) { |
|
|
|
|
long avvisoId = ParamUtil.getLong(request, "avvisoId"); |
|
|
|
|
AvvisoLocalServiceUtil.simulaFirma(avvisoId, serviceContext); |
|
|
|
|
} else { |
|
|
|
|
throw new PortletException("Firma simulata non permessa"); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// ADT BUG-ID=16 Sezione Pratiche Assegnate / Export CSV delle firme
|
|
|
|
|
@Override |
|
|
|
|
public void serveResource(ResourceRequest resourceRequest, ResourceResponse resourceResponse) throws IOException, |
|
|
|
|
PortletException { |
|
|
|
|
public void serveResource(ResourceRequest request, ResourceResponse response) throws IOException, PortletException { |
|
|
|
|
|
|
|
|
|
String resourceId = GetterUtil.getString(resourceRequest.getResourceID()); |
|
|
|
|
String resourceId = GetterUtil.getString(request.getResourceID()); |
|
|
|
|
if (resourceId.equals("exportCSV")) { |
|
|
|
|
ThemeDisplay themeDisplay = (ThemeDisplay) resourceRequest.getAttribute(WebKeys.THEME_DISPLAY); |
|
|
|
|
ThemeDisplay themeDisplay = (ThemeDisplay) request.getAttribute(WebKeys.THEME_DISPLAY); |
|
|
|
|
long companyId = themeDisplay.getCompanyId(); |
|
|
|
|
Locale locale = themeDisplay.getLocale(); |
|
|
|
|
User user = themeDisplay.getUser(); |
|
|
|
|
String tabs1 = ParamUtil.getString(resourceRequest, "tabs1"); |
|
|
|
|
String tabs1 = ParamUtil.getString(request, "tabs1"); |
|
|
|
|
try { |
|
|
|
|
|
|
|
|
|
String csv = null; |
|
|
|
|
String fileName = null; |
|
|
|
|
if ("Tab_AvvisiDaFirmare".equals(tabs1)) { |
|
|
|
@ -106,15 +113,15 @@ public class GestioneFirmePortlet extends MVCPortlet {
|
|
|
|
|
fileName = "da_firmare"; |
|
|
|
|
csv = exportToCSVAvvisiFirme(companyId, user.getScreenName(), locale); |
|
|
|
|
} |
|
|
|
|
HttpServletRequest request = PortalUtil.getHttpServletRequest(resourceRequest); |
|
|
|
|
HttpServletResponse response = PortalUtil.getHttpServletResponse(resourceResponse); |
|
|
|
|
ServletResponseUtil.sendFile(request, response, "export_firme_" + fileName + ".csv", |
|
|
|
|
HttpServletRequest httpRequest = PortalUtil.getHttpServletRequest(request); |
|
|
|
|
HttpServletResponse httpResponse = PortalUtil.getHttpServletResponse(response); |
|
|
|
|
ServletResponseUtil.sendFile(httpRequest, httpResponse, "export_firme_" + fileName + ".csv", |
|
|
|
|
csv.getBytes(StringPool.UTF8), ContentTypes.TEXT_CSV_UTF8); |
|
|
|
|
} catch (Exception e) { |
|
|
|
|
throw new IOException(e); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
super.serveResource(resourceRequest, resourceResponse); |
|
|
|
|
super.serveResource(request, response); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// ADT BUG-ID=16 Sezione Pratiche Assegnate / Export CSV delle firme
|
|
|
|
@ -124,18 +131,16 @@ public class GestioneFirmePortlet extends MVCPortlet {
|
|
|
|
|
StringBuilder sb = new StringBuilder(); |
|
|
|
|
List<Avviso> lista = AvvisoLocalServiceUtil.getAvvisiFirmatiByCF(companyId, cf, QueryUtil.ALL_POS, |
|
|
|
|
QueryUtil.ALL_POS); |
|
|
|
|
sb.append(CSVUtil.encode(LanguageUtil.get(getPortletConfig(), locale, "label.avviso.progetto"))) |
|
|
|
|
.append(StringPool.SEMICOLON) |
|
|
|
|
sb.append(CSVUtil.encode(LanguageUtil.get(getPortletConfig(), locale, "label.avviso.progetto"))).append(':') |
|
|
|
|
.append(CSVUtil.encode(LanguageUtil.get(getPortletConfig(), locale, "label.avviso.protocollo"))) |
|
|
|
|
.append(StringPool.SEMICOLON) |
|
|
|
|
.append(':') |
|
|
|
|
.append(CSVUtil.encode(LanguageUtil.get(getPortletConfig(), locale, "label.avviso.descrizione"))) |
|
|
|
|
.append(StringPool.SEMICOLON) |
|
|
|
|
.append(CSVUtil.encode(LanguageUtil.get(getPortletConfig(), locale, "provincia"))) |
|
|
|
|
.append(StringPool.SEMICOLON) |
|
|
|
|
.append(':').append(CSVUtil.encode(LanguageUtil.get(getPortletConfig(), locale, "provincia"))) |
|
|
|
|
.append(':') |
|
|
|
|
.append(CSVUtil.encode(LanguageUtil.get(getPortletConfig(), locale, "label.avviso.dataAvviso"))) |
|
|
|
|
.append(StringPool.SEMICOLON) |
|
|
|
|
.append(':') |
|
|
|
|
.append(CSVUtil.encode(LanguageUtil.get(getPortletConfig(), locale, "label.avviso.tipoDocumento"))) |
|
|
|
|
.append(StringPool.SEMICOLON).append(StringPool.NEW_LINE); |
|
|
|
|
.append(':').append('\n'); |
|
|
|
|
for (Iterator<Avviso> iterator = lista.iterator(); iterator.hasNext();) { |
|
|
|
|
Avviso avviso = iterator.next(); |
|
|
|
|
DettPratica dettPratica = DettPraticaLocalServiceUtil.fetchDettPratica(avviso.getClassPk()); |
|
|
|
@ -150,18 +155,18 @@ public class GestioneFirmePortlet extends MVCPortlet {
|
|
|
|
|
long organizationId = GroupLocalServiceUtil.getGroup(territorioGroupId).getOrganizationId(); |
|
|
|
|
String genio = OrganizationLocalServiceUtil.getOrganization(organizationId).getName(); |
|
|
|
|
sb.append(CSVUtil.encode(intPratica.getNumeroProgetto())) |
|
|
|
|
.append(StringPool.SEMICOLON) |
|
|
|
|
.append(':') |
|
|
|
|
.append(Validator.isNull(dettPratica) ? StringPool.BLANK : CSVUtil.encode(dettPratica |
|
|
|
|
.getProtocollo())) |
|
|
|
|
.append(StringPool.SEMICOLON) |
|
|
|
|
.append(':') |
|
|
|
|
.append(CSVUtil.encode(avviso.getDescLong())) |
|
|
|
|
.append(StringPool.SEMICOLON) |
|
|
|
|
.append(':') |
|
|
|
|
.append(CSVUtil.encode(genio)) |
|
|
|
|
.append(StringPool.SEMICOLON) |
|
|
|
|
.append(':') |
|
|
|
|
.append(CSVUtil.encode(dateFormat.format(avviso.getDtAvviso()))) |
|
|
|
|
.append(StringPool.SEMICOLON) |
|
|
|
|
.append(':') |
|
|
|
|
.append(CSVUtil.encode(LanguageUtil.get(getPortletConfig(), locale, avviso.translateTipoDocumento()))) |
|
|
|
|
.append(StringPool.SEMICOLON).append(StringPool.NEW_LINE); |
|
|
|
|
.append(':').append('\n'); |
|
|
|
|
} |
|
|
|
|
return sb.toString(); |
|
|
|
|
} |
|
|
|
@ -171,30 +176,27 @@ public class GestioneFirmePortlet extends MVCPortlet {
|
|
|
|
|
|
|
|
|
|
Format dateFormat = FastDateFormatFactoryUtil.getDate(locale); |
|
|
|
|
StringBuilder sb = new StringBuilder(); |
|
|
|
|
long[] gruopIds = new long[0]; |
|
|
|
|
long[] groupIds = new long[0]; |
|
|
|
|
List<Organization> organizations = OrganizationLocalServiceUtil.getUserOrganizations(user.getUserId()); |
|
|
|
|
for (Organization organization : organizations) { |
|
|
|
|
if (UserGroupRoleLocalServiceUtil.hasUserGroupRole(user.getUserId(), organization.getGroupId(), |
|
|
|
|
Constants.ROLE_NAME_FIRMA, true)) { |
|
|
|
|
gruopIds = ArrayUtil.append(gruopIds, organization.getGroupId()); |
|
|
|
|
groupIds = ArrayUtil.append(groupIds, organization.getGroupId()); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
List<Avviso> lista = AvvisoLocalServiceUtil.getAvvisiDaFirmarePrimaFirmaByNotCF(companyId, gruopIds, |
|
|
|
|
List<Avviso> lista = AvvisoLocalServiceUtil.getAvvisiDaFirmarePrimaFirmaByNotCF(companyId, groupIds, |
|
|
|
|
user.getScreenName(), QueryUtil.ALL_POS, QueryUtil.ALL_POS); |
|
|
|
|
sb.append(CSVUtil.encode(LanguageUtil.get(getPortletConfig(), locale, "label.avviso.progetto"))) |
|
|
|
|
.append(StringPool.SEMICOLON) |
|
|
|
|
sb.append(CSVUtil.encode(LanguageUtil.get(getPortletConfig(), locale, "label.avviso.progetto"))).append(':') |
|
|
|
|
.append(CSVUtil.encode(LanguageUtil.get(getPortletConfig(), locale, "label.avviso.protocollo"))) |
|
|
|
|
.append(StringPool.SEMICOLON) |
|
|
|
|
.append(':') |
|
|
|
|
.append(CSVUtil.encode(LanguageUtil.get(getPortletConfig(), locale, "label.avviso.descrizione"))) |
|
|
|
|
.append(StringPool.SEMICOLON) |
|
|
|
|
.append(CSVUtil.encode(LanguageUtil.get(getPortletConfig(), locale, "provincia"))) |
|
|
|
|
.append(StringPool.SEMICOLON) |
|
|
|
|
.append(':').append(CSVUtil.encode(LanguageUtil.get(getPortletConfig(), locale, "provincia"))) |
|
|
|
|
.append(':') |
|
|
|
|
.append(CSVUtil.encode(LanguageUtil.get(getPortletConfig(), locale, "label.avviso.dataAvviso"))) |
|
|
|
|
.append(StringPool.SEMICOLON) |
|
|
|
|
.append(':') |
|
|
|
|
.append(CSVUtil.encode(LanguageUtil.get(getPortletConfig(), locale, "label.avviso.tipoDocumento"))) |
|
|
|
|
.append(StringPool.SEMICOLON) |
|
|
|
|
.append(CSVUtil.encode(LanguageUtil.get(getPortletConfig(), locale, "label.avviso.firma"))) |
|
|
|
|
.append(StringPool.SEMICOLON).append(StringPool.NEW_LINE); |
|
|
|
|
.append(':').append(CSVUtil.encode(LanguageUtil.get(getPortletConfig(), locale, "label.avviso.firma"))) |
|
|
|
|
.append(':').append('\n'); |
|
|
|
|
for (Iterator<Avviso> iterator = lista.iterator(); iterator.hasNext();) { |
|
|
|
|
Avviso avviso = iterator.next(); |
|
|
|
|
DettPratica dettPratica = DettPraticaLocalServiceUtil.fetchDettPratica(avviso.getClassPk()); |
|
|
|
@ -211,20 +213,19 @@ public class GestioneFirmePortlet extends MVCPortlet {
|
|
|
|
|
String cf = avviso.getUserCodiceFiscalePrimaFirma(); |
|
|
|
|
User userFirma = UserLocalServiceUtil.fetchUserByScreenName(companyId, cf); |
|
|
|
|
sb.append(CSVUtil.encode(intPratica.getNumeroProgetto())) |
|
|
|
|
.append(StringPool.SEMICOLON) |
|
|
|
|
.append(':') |
|
|
|
|
.append(Validator.isNull(dettPratica) ? StringPool.BLANK : CSVUtil.encode(dettPratica |
|
|
|
|
.getProtocollo())) |
|
|
|
|
.append(StringPool.SEMICOLON) |
|
|
|
|
.append(':') |
|
|
|
|
.append(CSVUtil.encode(avviso.getDescLong())) |
|
|
|
|
.append(StringPool.SEMICOLON) |
|
|
|
|
.append(':') |
|
|
|
|
.append(CSVUtil.encode(genio)) |
|
|
|
|
.append(StringPool.SEMICOLON) |
|
|
|
|
.append(':') |
|
|
|
|
.append(CSVUtil.encode(dateFormat.format(avviso.getDtAvviso()))) |
|
|
|
|
.append(StringPool.SEMICOLON) |
|
|
|
|
.append(':') |
|
|
|
|
.append(CSVUtil.encode(LanguageUtil.get(getPortletConfig(), locale, avviso.translateTipoDocumento()))) |
|
|
|
|
.append(StringPool.SEMICOLON) |
|
|
|
|
.append(CSVUtil.encode(Validator.isNull(userFirma) ? cf : userFirma.getFullName())) |
|
|
|
|
.append(StringPool.SEMICOLON).append(StringPool.NEW_LINE); |
|
|
|
|
.append(':').append(CSVUtil.encode(Validator.isNull(userFirma) ? cf : userFirma.getFullName())) |
|
|
|
|
.append(':').append('\n'); |
|
|
|
|
} |
|
|
|
|
return sb.toString(); |
|
|
|
|
} |
|
|
|
@ -238,19 +239,17 @@ public class GestioneFirmePortlet extends MVCPortlet {
|
|
|
|
|
user.getScreenName(), QueryUtil.ALL_POS, QueryUtil.ALL_POS); |
|
|
|
|
sb.append("LE TUE FIRME\n") |
|
|
|
|
.append(CSVUtil.encode(LanguageUtil.get(getPortletConfig(), locale, "label.avviso.progetto"))) |
|
|
|
|
.append(StringPool.SEMICOLON) |
|
|
|
|
.append(':') |
|
|
|
|
.append(CSVUtil.encode(LanguageUtil.get(getPortletConfig(), locale, "label.avviso.protocollo"))) |
|
|
|
|
.append(StringPool.SEMICOLON) |
|
|
|
|
.append(':') |
|
|
|
|
.append(CSVUtil.encode(LanguageUtil.get(getPortletConfig(), locale, "label.avviso.descrizione"))) |
|
|
|
|
.append(StringPool.SEMICOLON) |
|
|
|
|
.append(CSVUtil.encode(LanguageUtil.get(getPortletConfig(), locale, "provincia"))) |
|
|
|
|
.append(StringPool.SEMICOLON) |
|
|
|
|
.append(':').append(CSVUtil.encode(LanguageUtil.get(getPortletConfig(), locale, "provincia"))) |
|
|
|
|
.append(':') |
|
|
|
|
.append(CSVUtil.encode(LanguageUtil.get(getPortletConfig(), locale, "label.avviso.dataAvviso"))) |
|
|
|
|
.append(StringPool.SEMICOLON) |
|
|
|
|
.append(':') |
|
|
|
|
.append(CSVUtil.encode(LanguageUtil.get(getPortletConfig(), locale, "label.avviso.tipoDocumento"))) |
|
|
|
|
.append(StringPool.SEMICOLON) |
|
|
|
|
.append(CSVUtil.encode(LanguageUtil.get(getPortletConfig(), locale, "label.avviso.firma"))) |
|
|
|
|
.append(StringPool.SEMICOLON).append(StringPool.NEW_LINE); |
|
|
|
|
.append(':').append(CSVUtil.encode(LanguageUtil.get(getPortletConfig(), locale, "label.avviso.firma"))) |
|
|
|
|
.append(':').append('\n'); |
|
|
|
|
for (Iterator<Avviso> iterator = listaLeTueFirme.iterator(); iterator.hasNext();) { |
|
|
|
|
Avviso avviso = iterator.next(); |
|
|
|
|
DettPratica dettPratica = DettPraticaLocalServiceUtil.fetchDettPratica(avviso.getClassPk()); |
|
|
|
@ -267,70 +266,68 @@ public class GestioneFirmePortlet extends MVCPortlet {
|
|
|
|
|
String cf = avviso.getUserCodiceFiscalePrimaFirma(); |
|
|
|
|
User userFirma = UserLocalServiceUtil.fetchUserByScreenName(companyId, cf); |
|
|
|
|
sb.append(CSVUtil.encode(intPratica.getNumeroProgetto())) |
|
|
|
|
.append(StringPool.SEMICOLON) |
|
|
|
|
.append(':') |
|
|
|
|
.append(Validator.isNull(dettPratica) ? StringPool.BLANK : CSVUtil.encode(dettPratica |
|
|
|
|
.getProtocollo())) |
|
|
|
|
.append(StringPool.SEMICOLON) |
|
|
|
|
.append(':') |
|
|
|
|
.append(CSVUtil.encode(avviso.getDescLong())) |
|
|
|
|
.append(StringPool.SEMICOLON) |
|
|
|
|
.append(':') |
|
|
|
|
.append(CSVUtil.encode(genio)) |
|
|
|
|
.append(StringPool.SEMICOLON) |
|
|
|
|
.append(':') |
|
|
|
|
.append(CSVUtil.encode(dateFormat.format(avviso.getDtAvviso()))) |
|
|
|
|
.append(StringPool.SEMICOLON) |
|
|
|
|
.append(':') |
|
|
|
|
.append(CSVUtil.encode(LanguageUtil.get(getPortletConfig(), locale, avviso.translateTipoDocumento()))) |
|
|
|
|
.append(StringPool.SEMICOLON) |
|
|
|
|
.append(CSVUtil.encode(Validator.isNull(userFirma) ? cf : userFirma.getFullName())) |
|
|
|
|
.append(StringPool.SEMICOLON).append(StringPool.NEW_LINE); |
|
|
|
|
.append(':').append(CSVUtil.encode(Validator.isNull(userFirma) ? cf : userFirma.getFullName())) |
|
|
|
|
.append(':').append('\n'); |
|
|
|
|
} |
|
|
|
|
long[] gruopIds = new long[0]; |
|
|
|
|
long[] groupIds = new long[0]; |
|
|
|
|
List<Organization> organizations = OrganizationLocalServiceUtil.getUserOrganizations(user.getUserId()); |
|
|
|
|
for (Organization organization : organizations) { |
|
|
|
|
if (UserGroupRoleLocalServiceUtil.hasUserGroupRole(user.getUserId(), organization.getGroupId(), |
|
|
|
|
Constants.ROLE_NAME_FIRMA, true)) { |
|
|
|
|
gruopIds = ArrayUtil.append(gruopIds, organization.getGroupId()); |
|
|
|
|
groupIds = ArrayUtil.append(groupIds, organization.getGroupId()); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
List<Avviso> listaFirmeAssegnateAlRuolo = AvvisoLocalServiceUtil.getAvvisiDaFirmarePrimaFirma(companyId, |
|
|
|
|
gruopIds, QueryUtil.ALL_POS, QueryUtil.ALL_POS); |
|
|
|
|
groupIds, QueryUtil.ALL_POS, QueryUtil.ALL_POS); |
|
|
|
|
sb.append("\n\nFIRME ASSEGNATE AL RUOLO\n") |
|
|
|
|
.append(CSVUtil.encode(LanguageUtil.get(getPortletConfig(), locale, "label.avviso.progetto"))) |
|
|
|
|
.append(StringPool.SEMICOLON) |
|
|
|
|
.append(':') |
|
|
|
|
.append(CSVUtil.encode(LanguageUtil.get(getPortletConfig(), locale, "label.avviso.protocollo"))) |
|
|
|
|
.append(StringPool.SEMICOLON) |
|
|
|
|
.append(':') |
|
|
|
|
.append(CSVUtil.encode(LanguageUtil.get(getPortletConfig(), locale, "label.avviso.descrizione"))) |
|
|
|
|
.append(StringPool.SEMICOLON) |
|
|
|
|
.append(CSVUtil.encode(LanguageUtil.get(getPortletConfig(), locale, "provincia"))) |
|
|
|
|
.append(StringPool.SEMICOLON) |
|
|
|
|
.append(':').append(CSVUtil.encode(LanguageUtil.get(getPortletConfig(), locale, "provincia"))) |
|
|
|
|
.append(':') |
|
|
|
|
.append(CSVUtil.encode(LanguageUtil.get(getPortletConfig(), locale, "label.avviso.dataAvviso"))) |
|
|
|
|
.append(StringPool.SEMICOLON) |
|
|
|
|
.append(':') |
|
|
|
|
.append(CSVUtil.encode(LanguageUtil.get(getPortletConfig(), locale, "label.avviso.tipoDocumento"))) |
|
|
|
|
.append(StringPool.SEMICOLON).append(StringPool.NEW_LINE); |
|
|
|
|
.append(':').append('\n'); |
|
|
|
|
for (Iterator<Avviso> iterator = listaFirmeAssegnateAlRuolo.iterator(); iterator.hasNext();) { |
|
|
|
|
Avviso avviso = iterator.next(); |
|
|
|
|
DettPratica dettPratica = DettPraticaLocalServiceUtil.fetchDettPratica(avviso.getClassPk()); |
|
|
|
|
IntPratica intPratica = null; |
|
|
|
|
if (Validator.isNotNull(dettPratica)) { |
|
|
|
|
intPratica = IntPraticaLocalServiceUtil.getIntPratica(dettPratica.getIntPraticaId()); |
|
|
|
|
} else { |
|
|
|
|
if (Validator.isNull(dettPratica)) { |
|
|
|
|
intPratica = IntPraticaLocalServiceUtil.getIntPratica(avviso.getIntPraticaId()); |
|
|
|
|
} else { |
|
|
|
|
intPratica = IntPraticaLocalServiceUtil.getIntPratica(dettPratica.getIntPraticaId()); |
|
|
|
|
} |
|
|
|
|
long territorioGroupId = TerritorioLocalServiceUtil.getTerritorio(intPratica.getTerritorioId()) |
|
|
|
|
.getGroupId(); |
|
|
|
|
long organizationId = GroupLocalServiceUtil.getGroup(territorioGroupId).getOrganizationId(); |
|
|
|
|
String genio = OrganizationLocalServiceUtil.getOrganization(organizationId).getName(); |
|
|
|
|
sb.append(CSVUtil.encode(intPratica.getNumeroProgetto())) |
|
|
|
|
.append(StringPool.SEMICOLON) |
|
|
|
|
.append(':') |
|
|
|
|
.append(Validator.isNull(dettPratica) ? StringPool.BLANK : CSVUtil.encode(dettPratica |
|
|
|
|
.getProtocollo())) |
|
|
|
|
.append(StringPool.SEMICOLON) |
|
|
|
|
.append(':') |
|
|
|
|
.append(CSVUtil.encode(avviso.getDescLong())) |
|
|
|
|
.append(StringPool.SEMICOLON) |
|
|
|
|
.append(':') |
|
|
|
|
.append(CSVUtil.encode(genio)) |
|
|
|
|
.append(StringPool.SEMICOLON) |
|
|
|
|
.append(':') |
|
|
|
|
.append(CSVUtil.encode(dateFormat.format(avviso.getDtAvviso()))) |
|
|
|
|
.append(StringPool.SEMICOLON) |
|
|
|
|
.append(':') |
|
|
|
|
.append(CSVUtil.encode(LanguageUtil.get(getPortletConfig(), locale, avviso.translateTipoDocumento()))) |
|
|
|
|
.append(StringPool.SEMICOLON).append(StringPool.NEW_LINE); |
|
|
|
|
.append(':').append('\n'); |
|
|
|
|
} |
|
|
|
|
return sb.toString(); |
|
|
|
|
} |
|
|
|
|