public static void main(String[] args) {
OrderManager orderManager = (OrderManager) ModelUtil
.getBean("orderManager");
FrontProductionVManager frontProductionVManager = (FrontProductionVManager) ModelUtil
.getBean("frontProductionVManager");
VeggProductionVManager veggProductionVManager = (VeggProductionVManager) ModelUtil
.getBean("veggProductionVManager");
List<Order> orders = orderManager.findAllNotSent();
for (Order order : orders) {
orderManager.lazyLoadOrder(order, new LazyLoadOrderEnum[] {
LazyLoadOrderEnum.COMMENTS, LazyLoadOrderEnum.COLLIES });
order.cacheComments();
order.cacheGarageColliHeight();
try {
orderManager.saveOrder(order);
} catch (ProTransException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
List<Produceable> fronter = frontProductionVManager.findAllApplyable();
StatusCheckerInterface<Transportable> veggChecker = Util
.getVeggChecker();
for (Produceable front : fronter) {
Map<String, String> statusMap = Util
.createStatusMap(((FrontProductionV) front)
.getOrderStatus());
String status = statusMap.get(veggChecker.getArticleName());
if (status == null) {
Order order = orderManager
.findByOrderNr(((FrontProductionV) front).getOrderNr());
if (order != null) {
orderManager.lazyLoadTree(order);
status = veggChecker.getArticleStatus(order);
statusMap.put(veggChecker.getArticleName(), status);
order.setStatus(Util.statusMapToString(statusMap));
try {
orderManager.saveOrder(order);
} catch (ProTransException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
}
List<Produceable> vegger = veggProductionVManager.findAllApplyable();
StatusCheckerInterface<Transportable> frontChecker = Util
.getFrontChecker();
for (Produceable vegg : vegger) {