Set Tracing Id in Warehouse/finish not in Checkout. This was wrong.

This commit is contained in:
CodeSteak 2020-06-03 16:55:36 +02:00
parent fc239983a7
commit a192f0ac51
3 changed files with 7 additions and 3 deletions

View File

@ -1,5 +1,6 @@
package org.hso.ecommerce.controller.intern.warehouse; package org.hso.ecommerce.controller.intern.warehouse;
import org.hso.ecommerce.action.shop.EnableTrackingAction;
import org.hso.ecommerce.entities.warehouse.WarehouseBooking; import org.hso.ecommerce.entities.warehouse.WarehouseBooking;
import org.hso.ecommerce.repos.warehouse.WarehouseBookingRepository; import org.hso.ecommerce.repos.warehouse.WarehouseBookingRepository;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -69,6 +70,11 @@ public class TodoController {
booking.get().isInProgress = true; booking.get().isInProgress = true;
booking.get().isDone = true; booking.get().isDone = true;
// Update Delivery Date
if (booking.get().reason.customerOrder != null) {
EnableTrackingAction.addTrackingInfo(booking.get().reason.customerOrder);
}
warehouseBookingRepository.save(booking.get()); warehouseBookingRepository.save(booking.get());
return "redirect:/intern/warehouse/todo"; return "redirect:/intern/warehouse/todo";

View File

@ -1,7 +1,6 @@
package org.hso.ecommerce.controller.shop; package org.hso.ecommerce.controller.shop;
import org.hso.ecommerce.action.shop.CreateOrderAction; import org.hso.ecommerce.action.shop.CreateOrderAction;
import org.hso.ecommerce.action.shop.EnableTrackingAction;
import org.hso.ecommerce.entities.booking.BookingAccountEntry; import org.hso.ecommerce.entities.booking.BookingAccountEntry;
import org.hso.ecommerce.entities.booking.PaymentMethod; import org.hso.ecommerce.entities.booking.PaymentMethod;
import org.hso.ecommerce.entities.shop.Address; import org.hso.ecommerce.entities.shop.Address;
@ -136,7 +135,6 @@ public class ShopCheckoutController {
CreateOrderAction.Result result = null; CreateOrderAction.Result result = null;
try { try {
result = action.finish(); result = action.finish();
EnableTrackingAction.addTrackingInfo(result.customerOrder);
customerOderRepository.save(result.customerOrder); customerOderRepository.save(result.customerOrder);
bookingRepository.saveAll(result.bookings); bookingRepository.saveAll(result.bookings);

View File

@ -31,7 +31,7 @@ public class CustomerOrder {
@NotNull @NotNull
public java.sql.Timestamp created; public java.sql.Timestamp created;
@NotNull @Column(nullable = true)
public String trackingId; public String trackingId;
@Column(nullable = true) @Column(nullable = true)