Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update plans after stock and structure mutation #1203

Merged
merged 7 commits into from
Jan 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion configs
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<artifactId>opensrp-server-web</artifactId>
<packaging>war</packaging>
<version>2.10.11-SNAPSHOT</version>
<version>2.10.12-SNAPSHOT</version>
<name>opensrp-server-web</name>
<description>OpenSRP Server Web Application</description>
<url>https://github.com/OpenSRP/opensrp-server-web</url>
Expand All @@ -24,7 +24,7 @@
<redis.jedis.version>3.8.0</redis.jedis.version>
<opensrp.updatePolicy>always</opensrp.updatePolicy>
<nexus-staging-maven-plugin.version>1.5.1</nexus-staging-maven-plugin.version>
<opensrp.core.version>2.14.8-SNAPSHOT</opensrp.core.version>
<opensrp.core.version>2.14.9-SNAPSHOT</opensrp.core.version>
<opensrp.connector.version>2.4.1-SNAPSHOT</opensrp.connector.version>
<opensrp.interface.version>2.0.1-SNAPSHOT</opensrp.interface.version>
<powermock.version>2.0.5</powermock.version>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package org.opensrp.web.listener;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.opensrp.domain.postgres.Structure;
import org.opensrp.repository.StructureCreateOrUpdateEvent;
import org.opensrp.service.PhysicalLocationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationListener;
import org.springframework.stereotype.Component;

@Component
public class StructureRepositoryEventListener implements ApplicationListener<StructureCreateOrUpdateEvent> {
private static final Logger logger = LogManager.getLogger(StructureRepositoryEventListener.class.toString());
@Autowired
private PhysicalLocationService physicalLocationService;
@Override
public void onApplicationEvent(StructureCreateOrUpdateEvent structureCreateOrUpdateEvent) {
Structure structure = (Structure) structureCreateOrUpdateEvent.getSource();
logger.info("Receiving Structure Event");
physicalLocationService.regenerateTasksForOperationalArea(structure);
}
}
3 changes: 3 additions & 0 deletions src/main/resources/spring/listener-context.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@
<task:scheduler pool-size="1" id="dhis2Scheduler"/>
<task:scheduler pool-size="1" id="messageScheduler"/>

<bean id="structureRepositoryEventListener"
class="org.opensrp.web.listener.StructureRepositoryEventListener"/>

<beans profile="rapidpro">
<bean id="dhis2" class="org.opensrp.web.listener.DHIS2ConnectorListener"></bean>
<task:scheduled-tasks scheduler="dhis2Scheduler">
Expand Down
Loading