|
|
@ -4,6 +4,7 @@ import info.bukova.isspst.AddressUtils;
|
|
|
|
import info.bukova.isspst.data.Address;
|
|
|
|
import info.bukova.isspst.data.Address;
|
|
|
|
import info.bukova.isspst.data.AddressEmb;
|
|
|
|
import info.bukova.isspst.data.AddressEmb;
|
|
|
|
import info.bukova.isspst.data.Order;
|
|
|
|
import info.bukova.isspst.data.Order;
|
|
|
|
|
|
|
|
import info.bukova.isspst.data.OrderItem;
|
|
|
|
import info.bukova.isspst.data.SettingsData;
|
|
|
|
import info.bukova.isspst.data.SettingsData;
|
|
|
|
import info.bukova.isspst.data.User;
|
|
|
|
import info.bukova.isspst.data.User;
|
|
|
|
import info.bukova.isspst.filters.OrderFilter;
|
|
|
|
import info.bukova.isspst.filters.OrderFilter;
|
|
|
@ -13,12 +14,17 @@ import info.bukova.isspst.services.settings.GlobalSettingsService;
|
|
|
|
import info.bukova.isspst.services.users.UserService;
|
|
|
|
import info.bukova.isspst.services.users.UserService;
|
|
|
|
import info.bukova.isspst.ui.ListViewModel;
|
|
|
|
import info.bukova.isspst.ui.ListViewModel;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
import java.util.List;
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
|
|
|
|
import org.slf4j.Logger;
|
|
|
|
import org.slf4j.Logger;
|
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
|
|
|
|
|
import org.zkoss.bind.annotation.BindingParam;
|
|
|
|
|
|
|
|
import org.zkoss.bind.annotation.Command;
|
|
|
|
import org.zkoss.bind.annotation.Init;
|
|
|
|
import org.zkoss.bind.annotation.Init;
|
|
|
|
|
|
|
|
import org.zkoss.bind.annotation.NotifyChange;
|
|
|
|
import org.zkoss.zk.ui.select.annotation.WireVariable;
|
|
|
|
import org.zkoss.zk.ui.select.annotation.WireVariable;
|
|
|
|
|
|
|
|
import org.zkoss.zul.Listbox;
|
|
|
|
|
|
|
|
|
|
|
|
public class OrderList extends ListViewModel<Order>
|
|
|
|
public class OrderList extends ListViewModel<Order>
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -37,6 +43,10 @@ public class OrderList extends ListViewModel<Order>
|
|
|
|
@WireVariable
|
|
|
|
@WireVariable
|
|
|
|
protected UserService userService;
|
|
|
|
protected UserService userService;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
protected OrderItem selectedOrderItem;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
protected List<OrderItem> orderItems;
|
|
|
|
|
|
|
|
|
|
|
|
@Init(superclass = true)
|
|
|
|
@Init(superclass = true)
|
|
|
|
public void initOrderList()
|
|
|
|
public void initOrderList()
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -44,6 +54,7 @@ public class OrderList extends ListViewModel<Order>
|
|
|
|
dataClass = Order.class;
|
|
|
|
dataClass = Order.class;
|
|
|
|
formZul = "orderForm.zul";
|
|
|
|
formZul = "orderForm.zul";
|
|
|
|
dataFilter = new OrderFilter(getFilterTemplate());
|
|
|
|
dataFilter = new OrderFilter(getFilterTemplate());
|
|
|
|
|
|
|
|
this.orderItems = new ArrayList<OrderItem>();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public List<AddressEmb> getSuppAddresses()
|
|
|
|
public List<AddressEmb> getSuppAddresses()
|
|
|
@ -85,4 +96,43 @@ public class OrderList extends ListViewModel<Order>
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return userService.getAll();
|
|
|
|
return userService.getAll();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public OrderItem getSelectedOrderItem()
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
return selectedOrderItem;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void setSelectedOrderItem(OrderItem selectedOrderItem)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
this.selectedOrderItem = selectedOrderItem;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public List<OrderItem> getOrderItems()
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
return orderItems;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void setOrderItems(List<OrderItem> orderItems)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
this.orderItems = orderItems;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Command
|
|
|
|
|
|
|
|
@NotifyChange("orderItems")
|
|
|
|
|
|
|
|
public void onChangeSelectOrder(@BindingParam("ctrl") Listbox lb)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
if (lb == null)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (lb.getSelectedIndex() > -1)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
this.orderItems = this.getDataBean().getItems();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
this.orderItems = new ArrayList<OrderItem>();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|