|
20 | 20 |
|
21 | 21 | import javax.validation.Valid; |
22 | 22 |
|
| 23 | +import org.energyos.espi.common.domain.RetailCustomer; |
23 | 24 | import org.energyos.espi.common.domain.Routes; |
24 | 25 | import org.energyos.espi.common.domain.Subscription; |
| 26 | +import org.energyos.espi.common.domain.UsagePoint; |
25 | 27 | import org.energyos.espi.common.service.NotificationService; |
26 | 28 | import org.energyos.espi.common.service.ResourceService; |
27 | 29 | import org.energyos.espi.common.service.RetailCustomerService; |
28 | 30 | import org.energyos.espi.common.service.UsagePointService; |
29 | 31 | import org.springframework.beans.factory.annotation.Autowired; |
30 | 32 | import org.springframework.security.access.prepost.PreAuthorize; |
31 | 33 | import org.springframework.stereotype.Controller; |
| 34 | +import org.springframework.transaction.annotation.Transactional; |
32 | 35 | import org.springframework.ui.ModelMap; |
33 | 36 | import org.springframework.validation.BindingResult; |
34 | 37 | import org.springframework.validation.Errors; |
@@ -75,11 +78,12 @@ public String create(@PathVariable Long retailCustomerId, @ModelAttribute("usage |
75 | 78 | if (result.hasErrors()) |
76 | 79 | return "/custodian/retailcustomers/usagepoints/form"; |
77 | 80 |
|
78 | | - Subscription subscription = retailCustomerService.associateByUUID(retailCustomerId, UUID.fromString(usagePointForm.getUUID())); |
| 81 | + Subscription subscription = retailCustomerService.associateByUUID(retailCustomerId, |
| 82 | + UUID.fromString(usagePointForm.getUUID())); |
| 83 | + |
79 | 84 | if (subscription != null) { |
80 | 85 | notificationService.notify(subscription, null, null); |
81 | 86 | } |
82 | | - |
83 | 87 | return "redirect:/custodian/retailcustomers"; |
84 | 88 | } |
85 | 89 |
|
|
0 commit comments