Skip to content
This repository was archived by the owner on Jul 1, 2025. It is now read-only.

Commit 2f7723d

Browse files
committed
Merge pull request #86 from jateeter/master
completed AssociateUsagePoint bug fix
2 parents 04125c4 + 2f22008 commit 2f7723d

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

src/main/java/org/energyos/espi/datacustodian/web/custodian/AssociateUsagePointController.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,18 @@
2020

2121
import javax.validation.Valid;
2222

23+
import org.energyos.espi.common.domain.RetailCustomer;
2324
import org.energyos.espi.common.domain.Routes;
2425
import org.energyos.espi.common.domain.Subscription;
26+
import org.energyos.espi.common.domain.UsagePoint;
2527
import org.energyos.espi.common.service.NotificationService;
2628
import org.energyos.espi.common.service.ResourceService;
2729
import org.energyos.espi.common.service.RetailCustomerService;
2830
import org.energyos.espi.common.service.UsagePointService;
2931
import org.springframework.beans.factory.annotation.Autowired;
3032
import org.springframework.security.access.prepost.PreAuthorize;
3133
import org.springframework.stereotype.Controller;
34+
import org.springframework.transaction.annotation.Transactional;
3235
import org.springframework.ui.ModelMap;
3336
import org.springframework.validation.BindingResult;
3437
import org.springframework.validation.Errors;
@@ -75,11 +78,12 @@ public String create(@PathVariable Long retailCustomerId, @ModelAttribute("usage
7578
if (result.hasErrors())
7679
return "/custodian/retailcustomers/usagepoints/form";
7780

78-
Subscription subscription = retailCustomerService.associateByUUID(retailCustomerId, UUID.fromString(usagePointForm.getUUID()));
81+
Subscription subscription = retailCustomerService.associateByUUID(retailCustomerId,
82+
UUID.fromString(usagePointForm.getUUID()));
83+
7984
if (subscription != null) {
8085
notificationService.notify(subscription, null, null);
8186
}
82-
8387
return "redirect:/custodian/retailcustomers";
8488
}
8589

0 commit comments

Comments
 (0)