Skip to content
Snippets Groups Projects
Commit a030ac8b authored by Benjamin Ulrich's avatar Benjamin Ulrich :speech_balloon: Committed by Johannes Goderbauer
Browse files

[Projekt: Entwicklung - Neon][TicketNr.: 1065178][Besuchsplanung...

[Projekt: Entwicklung - Neon][TicketNr.: 1065178][Besuchsplanung VISITRECOMMENDATION.PRIORITY ist das Feld vom Typ CHAR(36) anstelle von VARCHAR]
parent 13c3769f
No related branches found
No related tags found
No related merge requests found
Showing
with 169 additions and 34 deletions
<?xml version="1.1" encoding="UTF-8" standalone="no"?>
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.6.xsd">
<changeSet author="b.ulrich" id="2c14c955-e312-4085-bf3e-9a07cf8a39b6">
<update tableName="AB_KEYWORD_ENTRY">
<column name="KEYID" value="VISITSTATUSPLANNED"/>
<where>AB_KEYWORD_ENTRYID='9d427420-2c87-4ada-9349-a799972bda0f'</where>
</update>
<update tableName="AB_KEYWORD_ENTRY">
<column name="KEYID" value="VISITSTATUSAPPPLANED"/>
<where>AB_KEYWORD_ENTRYID='2f740f93-12ed-4e22-a158-adba5da81b40'</where>
</update>
<update tableName="AB_KEYWORD_ENTRY">
<column name="KEYID" value="VISITSTATUSREPORTCREATED"/>
<where>AB_KEYWORD_ENTRYID='dd276100-b867-489c-8128-a3b71aa7564f'</where>
</update>
<update tableName="AB_KEYWORD_ENTRY">
<column name="KEYID" value="MANUAL"/>
<where>AB_KEYWORD_ENTRYID='2f162837-868a-4517-810e-677cd423be56'</where>
</update>
<update tableName="AB_KEYWORD_ENTRY">
<column name="KEYID" value="VISITFREQUENCY"/>
<where>AB_KEYWORD_ENTRYID='17905c4d-1c88-4cee-83da-164c13bbe848'</where>
</update>
<update tableName="AB_KEYWORD_ENTRY">
<column name="KEYID" value="VISITPRIOCRITICAL"/>
<where>AB_KEYWORD_ENTRYID='91d7417e-fd45-429e-9ce9-a46f25c0c1d1'</where>
</update>
<update tableName="AB_KEYWORD_ENTRY">
<column name="KEYID" value="VISITPRIOCVERYHIGH"/>
<where>AB_KEYWORD_ENTRYID='c0147b73-f678-4136-b3c4-0fde7e943a84'</where>
</update>
<update tableName="AB_KEYWORD_ENTRY">
<column name="KEYID" value="VISITPRIOHIGH"/>
<where>AB_KEYWORD_ENTRYID='4ac4c7e1-d73b-4a26-9a6d-bc06505b9611'</where>
</update>
<update tableName="AB_KEYWORD_ENTRY">
<column name="KEYID" value="VISITPRIOMEDIUM"/>
<where>AB_KEYWORD_ENTRYID='facb77a6-5bc1-4e2f-8dd0-72200b57c326'</where>
</update>
<update tableName="AB_KEYWORD_ENTRY">
<column name="KEYID" value="VISITPRIOLOW"/>
<where>AB_KEYWORD_ENTRYID='036cbf6f-a8bd-4f25-b885-f1a689927bf1'</where>
</update>
</changeSet>
<!--*****
The data type has been set to CHAR(36) by accident, so let's change it back to VARCHAR(36) and update the data that is already persistant.
Tested on Apache Derby DB.
******-->
<!--second: change the type, dependent on the dbms-->
<changeSet dbms="derby" author="b.ulrich" id="30bdc4ef-1b99-43c6-8637-da20f64772c9">
<sql>
ALTER TABLE VISITRECOMMENDATION ADD COLUMN PRIORITY_NEW VARCHAR(36);
UPDATE VISITRECOMMENDATION SET PRIORITY_NEW=PRIORITY;
ALTER TABLE VISITRECOMMENDATION DROP COLUMN PRIORITY;
RENAME COLUMN VISITRECOMMENDATION.PRIORITY_NEW TO PRIORITY;
ALTER TABLE VISITPLANENTRY ADD COLUMN STATUS_NEW VARCHAR(36);
UPDATE VISITPLANENTRY SET STATUS_NEW=STATUS;
ALTER TABLE VISITPLANENTRY DROP COLUMN STATUS;
RENAME COLUMN VISITPLANENTRY.STATUS_NEW TO STATUS;
ALTER TABLE VISITRECOMMENDATION ADD COLUMN SOURCE_NEW VARCHAR(36);
UPDATE VISITRECOMMENDATION SET SOURCE_NEW=SOURCE;
ALTER TABLE VISITRECOMMENDATION DROP COLUMN SOURCE;
RENAME COLUMN VISITRECOMMENDATION.SOURCE_NEW TO SOURCE;
</sql>
</changeSet>
<changeSet dbms="!derby" author="b.ulrich" id="ec6f82ad-491b-4e0a-a24c-e45ea0e494de">
<modifyDataType tableName="VISITRECOMMENDATION" columnName="PRIORITY" newDataType="VARCHAR(36)"/>
<modifyDataType tableName="VISITPLANENTRY" columnName="STATUS" newDataType="VARCHAR(36)"/>
<modifyDataType tableName="VISITRECOMMENDATION" columnName="SOURCE" newDataType="VARCHAR(36)"/>
</changeSet>
<!--third: update data that now contains the data with spaces at the end-->
<!--MS SQL supports the regular trim-function with MS SQL 2017 or higher, so lets use the old ltrim/rtrim functions for better compability -->
<!--sauce: https://docs.microsoft.com/de-de/sql/t-sql/functions/trim-transact-sql?view=sql-server-ver15-->
<changeSet dbms="mssql" author="b.ulrich" id="d306d290-c3cf-42e2-8f28-e4a4cfa7d16f">
<update tableName="VISITRECOMMENDATION">
<column name="PRIORITY" valueComputed="ltrim(rtrim(PRIORITY))" />
<where>PRIORITY is not null</where>
</update>
<update tableName="VISITPLANENTRY">
<column name="STATUS" valueComputed="ltrim(rtrim(STATUS))" />
<where>STATUS is not null</where>
</update>
<update tableName="VISITRECOMMENDATION">
<column name="SOURCE" valueComputed="ltrim(rtrim(SOURCE))" />
<where>SOURCE is not null</where>
</update>
</changeSet>
<changeSet dbms="!mssql" author="b.ulrich" id="3fcc49d0-eb7d-4976-aff4-0e8b911e95af">
<update tableName="VISITRECOMMENDATION">
<column name="PRIORITY" valueComputed="trim(PRIORITY)" />
<where>PRIORITY is not null</where>
</update>
<update tableName="VISITPLANENTRY">
<column name="STATUS" valueComputed="trim(STATUS)" />
<where>STATUS is not null</where>
</update>
<update tableName="VISITRECOMMENDATION">
<column name="SOURCE" valueComputed="trim(SOURCE)" />
<where>SOURCE is not null</where>
</update>
</changeSet>
</databaseChangeLog>
\ No newline at end of file
......@@ -8,4 +8,5 @@
<include relativeToChangelogFile="true" file="optimizeIndizes.xml"/>
<include relativeToChangelogFile="true" file="addNotificationStateKeywords/addNotificationStateKeyword.xml"/>
<include relativeToChangelogFile="true" file="alter_ComunicationMedium_IdDatatype.xml"/>
<include relativeToChangelogFile="true" file="alter_VisitrecommendationpriorityDatatype.xml"/>
</databaseChangeLog>
<?xml version="1.1" encoding="UTF-8" standalone="no"?>
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog" xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.6.xsd">
<changeSet author="autogenerated" id="62ad16a9-7312-4dda-9e4b-460673b9af82">
<!--
<insert tableName="VISITPLANEMPLOYEEWEEK">
<column name="VISITPLANEMPLOYEEWEEKID" value="821b3424-b6d2-41f8-b0b2-6a7c2c050214"/>
<column name="VISITPLAN_YEAR" valueNumeric="2020"/>
......@@ -18,7 +17,7 @@
<column name="ORGANISATION_CONTACT_ID" value="f7b8f0c3-7702-4466-b502-d21fa4fa0010"/>
<column name ="CONTACT_ID" value="6c612f91-0160-4f09-9103-dccee7f7a6b7"/>
<column name="VISITPLANEMPLOYEEWEEK_ID" value="821b3424-b6d2-41f8-b0b2-6a7c2c050214"/>
<column name="STATUS" value="VISITSTATUSPLANNED "/>
<column name="STATUS" value="VISITSTATUSPLANNED"/>
</insert>
<insert tableName="VISITPLANENTRY">
<column name="VISITPLANENTRYID" value="9c6b378b-4738-47b6-9f19-3a1e26f3428e"/>
......@@ -28,7 +27,7 @@
<column name="ORGANISATION_CONTACT_ID" value="2c63e0de-f21c-474f-89d7-bff8ba1dbf43"/>
<column name ="CONTACT_ID" value="45635aca-7971-43df-a683-c80c86cb58cc"/>
<column name="VISITPLANEMPLOYEEWEEK_ID" value="821b3424-b6d2-41f8-b0b2-6a7c2c050214"/>
<column name="STATUS" value="VISITSTATUSPLANNED "/>
<column name="STATUS" value="VISITSTATUSPLANNED"/>
</insert>
<insert tableName="VISITPLANENTRY">
<column name="VISITPLANENTRYID" value="bd7b38d1-9ae1-4424-8c65-d9b0f3b000ba"/>
......@@ -38,7 +37,7 @@
<column name="ORGANISATION_CONTACT_ID" value="06006801-c6a1-4321-9fde-95f9d3f9b786"/>
<column name ="CONTACT_ID" value="ef345d11-a40d-59e0-a24c-afcb6095d2cb"/>
<column name="VISITPLANEMPLOYEEWEEK_ID" value="821b3424-b6d2-41f8-b0b2-6a7c2c050214"/>
<column name="STATUS" value="VISITSTATUSPLANNED "/>
<column name="STATUS" value="VISITSTATUSPLANNED"/>
</insert>
<insert tableName="VISITPLANENTRY">
<column name="VISITPLANENTRYID" value="5102104c-6baa-404f-9c71-157a8c79663a"/>
......@@ -48,7 +47,7 @@
<column name="ORGANISATION_CONTACT_ID" value="13e60843-5d6d-45ee-88c7-46db41874138"/>
<column name ="CONTACT_ID" value="79ce56fc-0022-4d5c-91b1-080c0f1e2191"/>
<column name="VISITPLANEMPLOYEEWEEK_ID" value="821b3424-b6d2-41f8-b0b2-6a7c2c050214"/>
<column name="STATUS" value="VISITSTATUSPLANNED "/>
<column name="STATUS" value="VISITSTATUSPLANNED"/>
</insert>
<insert tableName="VISITPLANEMPLOYEEWEEK">
......@@ -66,7 +65,7 @@
<column name="END_TIME" value="11:00"/>
<column name="ORGANISATION_CONTACT_ID" value="f7b8f0c3-7702-4466-b502-d21fa4fa0010"/>
<column name="VISITPLANEMPLOYEEWEEK_ID" value="73fbf25a-5668-411f-9ef5-42603d163a77"/>
<column name="STATUS" value="VISITSTATUSPLANNED "/>
<column name="STATUS" value="VISITSTATUSPLANNED"/>
</insert>
<insert tableName="VISITPLANENTRY">
<column name="VISITPLANENTRYID" value="f799a0cd-31bb-4be3-9fd9-0cbd0a3d55ac"/>
......@@ -75,7 +74,7 @@
<column name="END_TIME" value="11:00"/>
<column name="ORGANISATION_CONTACT_ID" value="82c7b72d-da4e-4fab-a6cc-31e1be07dd08"/>
<column name="VISITPLANEMPLOYEEWEEK_ID" value="73fbf25a-5668-411f-9ef5-42603d163a77"/>
<column name="STATUS" value="VISITSTATUSPLANNED "/>
<column name="STATUS" value="VISITSTATUSPLANNED"/>
</insert>
<insert tableName="VISITPLANENTRY">
<column name="VISITPLANENTRYID" value="ad325402-616c-495e-a7f5-a5ae6def0399"/>
......@@ -84,18 +83,17 @@
<column name="END_TIME" value="11:00"/>
<column name="ORGANISATION_CONTACT_ID" value="62175b31-b432-4ec6-932f-8e69033884c6"/>
<column name="VISITPLANEMPLOYEEWEEK_ID" value="73fbf25a-5668-411f-9ef5-42603d163a77"/>
<column name="STATUS" value="VISITSTATUSPLANNED "/>
<column name="STATUS" value="VISITSTATUSPLANNED"/>
</insert>
<insert tableName="VISITRECOMMENDATION">
<column name="VISITRECOMMENDATIONID" value="487eeff9-6807-41f6-95e9-5f0f61b45a05"/>
<column name="DUE_DATE" valueDate="2020-04-16T10:43:23"/>
<column name="PRIORITY" value="VISITPRIOMEDIUM "/>
<column name="SOURCE" value="MANUAL "/>
<column name="PRIORITY" value="VISITPRIOMEDIUM"/>
<column name="SOURCE" value="MANUAL"/>
<column name="CONTACT_ID" value="fc465f2f-803b-4a1f-b79d-7b466d7ecff4"/>
<column name="INFO" value="Kontrolltermin"/>
</insert>
-->
</changeSet>
</databaseChangeLog>
\ No newline at end of file
......@@ -14630,7 +14630,7 @@
<dbName></dbName>
<primaryKey v="false" />
<columnType v="12" />
<size v="255" />
<size v="36" />
<scale v="0" />
<notNull v="false" />
<isUnique v="false" />
......@@ -14671,7 +14671,7 @@
<name>PRIORITY</name>
<dbName></dbName>
<primaryKey v="false" />
<columnType v="1" />
<columnType v="12" />
<size v="36" />
<scale v="0" />
<notNull v="false" />
......@@ -14809,7 +14809,7 @@
<name>STATUS</name>
<dbName></dbName>
<primaryKey v="false" />
<columnType v="1" />
<columnType v="12" />
<size v="36" />
<scale v="0" />
<notNull v="false" />
......
......@@ -583,6 +583,12 @@
<fieldName>KeywordImportFields</fieldName>
<isConsumer v="false" />
</entityDependency>
<entityDependency>
<name>2823f5a0-2b1d-41f4-abf1-3e7b332fa176</name>
<entityName>VisitRecommendation_entity</entityName>
<fieldName>KeywordVisitRecommendationSource</fieldName>
<isConsumer v="false" />
</entityDependency>
</dependencies>
<children>
<entityParameter>
......
......@@ -58,6 +58,8 @@
<entityField>
<name>PRIORITY_SOURCE</name>
<title>Priority Source</title>
<consumer>KeywordVisitRecommendationSource</consumer>
<displayValueProcess>%aditoprj%/entity/VisitRecommendation_entity/entityfields/priority_source/displayValueProcess.js</displayValueProcess>
</entityField>
<entityField>
<name>DUE_DATE</name>
......@@ -158,6 +160,20 @@
<name>#PROVIDER_AGGREGATES</name>
<useAggregates v="true" />
</entityProvider>
<entityConsumer>
<name>KeywordVisitRecommendationSource</name>
<dependency>
<name>dependency</name>
<entityName>KeywordEntry_entity</entityName>
<fieldName>SpecificContainerKeywords</fieldName>
</dependency>
<children>
<entityParameter>
<name>ContainerName_param</name>
<valueProcess>%aditoprj%/entity/VisitRecommendation_entity/entityfields/keywordvisitrecommendationsource/children/containername_param/valueProcess.js</valueProcess>
</entityParameter>
</children>
</entityConsumer>
</entityFields>
<recordContainers>
<jDitoRecordContainer>
......
import("system.result");
import("Keyword_lib");
import("KeywordRegistry_basic");
result.string($KeywordRegistry.visitRecommendationPrioSource());
\ No newline at end of file
import("system.result");
import("system.vars");
import("Keyword_lib");
import("KeywordRegistry_basic");
result.string(KeywordUtils.getViewValue($KeywordRegistry.visitRecommendationPrioSource(), vars.get("$field.PRIORITY_SOURCE")));
\ No newline at end of file
......@@ -44,7 +44,7 @@ if(idValues == false)
.leftJoin("ORGANISATION", "ORGANISATION.ORGANISATIONID = CONTACT.ORGANISATION_ID")
.where("AB_ATTRIBUTE.AB_ATTRIBUTEID", $AttributeRegistry.visitPlanPointOfContact())
.cell(), AddressUtils.formatOnelineSql(),
"visitPlanFrequency.ID_VALUE", "'VISITFREQUENCY '", activitySubQuery, "CONTACTID",
"visitPlanFrequency.ID_VALUE", "'" + $KeywordRegistry.visitRecommendationPrioSource$visitFrequency()+"'" , activitySubQuery, "CONTACTID",
newSelect("min(ENTRYDATE)")
.from("VISITPLANENTRY")
.where("CONTACT.CONTACTID", "VISITPLANENTRY.ORGANISATION_CONTACT_ID")
......@@ -132,11 +132,12 @@ for( let i = 0; i < recommendationSQLData.length; i++)
tmpData[1] = organisationName; //Organisation Name
tmpData[3] = recommendationSQLData[i][6]; //Address
tmpData[4] = prio;
tmpData[5] = recommendationSQLData[i][4]; //Source of Priority
tmpData[5] = recommendationSQLData[i][4]; //Source of Priority (Id)
tmpData[7] = recommendationSQLData[i][3]; //Due Date
tmpData[8] = recommendationSQLData[i][5]; //Info
tmpData[9] = recommendationSQLData[i][1]; //CONTACT_ID
tmpData[2] = recommendationSQLData[i][8]; //Data_planned
tmpData[6] = KeywordUtils.getViewValue($KeywordRegistry.visitRecommendationPrioSource(), recommendationSQLData[i][4]) //Source of Priority (displayvalue)
recommendationData.push(tmpData);
......@@ -164,11 +165,12 @@ if(idValues == false)
tmpData[0] = visitFrequencyData[i][0]; //UID
tmpData[1] = visitFrequencyData[i][1]; //Organisation Name
tmpData[3] = visitFrequencyData[i][2]; //Address
tmpData[5] = visitFrequencyData[i][4]; //Source of Priority
tmpData[5] = visitFrequencyData[i][4]; //Source of Priority (Id)
tmpData[8] = "";
tmpData[4] = visitFrequencyData[i][5]; //last visit
tmpData[9] = visitFrequencyData[i][6]; //ContactId
tmpData[2] = visitFrequencyData[i][1]; //OrganisationId
tmpData[6] = KeywordUtils.getViewValue($KeywordRegistry.visitRecommendationPrioSource(), visitFrequencyData[i][4]) //Source of Priority (displayvalue)
var dueDate = "";
var lastVisitDate = "";
......
......@@ -16,8 +16,6 @@
* $KeywordRegistry.activityDirection()
*/
function $KeywordRegistry(){}
// this function can also be found as StringUtils.pad36() in Util_lib and is just here to avoid an import because this registry is heavily used.
$KeywordRegistry._autoPad = function(pKey){return (pKey + " ").slice(0, 36)};
$KeywordRegistry.attributeType = function(){return "AttributeType";};
$KeywordRegistry.keywordAttributeType = function(){return "KeywordAttributeType";};
......@@ -276,21 +274,21 @@ $KeywordRegistry.workflowActivityType$intermediateCatchEvent = function(){return
$KeywordRegistry.workflowActivityType$intermediateThrowEvent = function(){return "intermediateThrowEvent";};
$KeywordRegistry.exportTemplateSeparator$tab = function(){return "TAB";};
$KeywordRegistry.visitRecommendationPriority = function(){return $KeywordRegistry._autoPad("VisitRecommendationPriority");};
$KeywordRegistry.visitRecommendationPriority$critical = function(){return $KeywordRegistry._autoPad("VISITPRIOCRITICAL");};
$KeywordRegistry.visitRecommendationPriority$veryHigh = function(){return $KeywordRegistry._autoPad("VISITPRIOCVERYHIGH");};
$KeywordRegistry.visitRecommendationPriority$high = function(){return $KeywordRegistry._autoPad("VISITPRIOHIGH");};
$KeywordRegistry.visitRecommendationPriority$medium = function(){return $KeywordRegistry._autoPad("VISITPRIOMEDIUM");};
$KeywordRegistry.visitRecommendationPriority$low = function(){return $KeywordRegistry._autoPad("VISITPRIOLOW");};
$KeywordRegistry.visitPlanEntryStatus = function(){return $KeywordRegistry._autoPad("VisitPlanEntryStatus");};
$KeywordRegistry.visitPlanEntryStatus$planned = function(){return $KeywordRegistry._autoPad("VISITSTATUSPLANNED");};
$KeywordRegistry.visitPlanEntryStatus$Appointmentarranged = function(){return $KeywordRegistry._autoPad("VISITSTATUSAPPPLANED");};
$KeywordRegistry.visitPlanEntryStatus$Visitreportcreated = function(){return $KeywordRegistry._autoPad("VISITSTATUSREPORTCREATED");};
$KeywordRegistry.visitRecommendationPrioSource = function(){return $KeywordRegistry._autoPad("VisitRecommendationPrioSource");};
$KeywordRegistry.visitRecommendationPrioSource$visitFrequency = function(){return $KeywordRegistry._autoPad("VISITFREQUENCY");};
$KeywordRegistry.visitRecommendationPrioSource$manual = function(){return $KeywordRegistry._autoPad("MANUAL");};
$KeywordRegistry.visitRecommendationPriority = function(){return "VisitRecommendationPriority";};
$KeywordRegistry.visitRecommendationPriority$critical = function(){return "VISITPRIOCRITICAL";};
$KeywordRegistry.visitRecommendationPriority$veryHigh = function(){return "VISITPRIOCVERYHIGH";};
$KeywordRegistry.visitRecommendationPriority$high = function(){return "VISITPRIOHIGH";};
$KeywordRegistry.visitRecommendationPriority$medium = function(){return "VISITPRIOMEDIUM";};
$KeywordRegistry.visitRecommendationPriority$low = function(){return "VISITPRIOLOW";};
$KeywordRegistry.visitPlanEntryStatus = function(){return "VisitPlanEntryStatus";};
$KeywordRegistry.visitPlanEntryStatus$planned = function(){return "VISITSTATUSPLANNED";};
$KeywordRegistry.visitPlanEntryStatus$Appointmentarranged = function(){return "VISITSTATUSAPPPLANED";};
$KeywordRegistry.visitPlanEntryStatus$Visitreportcreated = function(){return "VISITSTATUSREPORTCREATED";};
$KeywordRegistry.visitRecommendationPrioSource = function(){return "VisitRecommendationPrioSource";};
$KeywordRegistry.visitRecommendationPrioSource$visitFrequency = function(){return "VISITFREQUENCY";};
$KeywordRegistry.visitRecommendationPrioSource$manual = function(){return "MANUAL";};
$KeywordRegistry.workflowCategory = function(){return "WorkflowCategory";};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment