예제 #1
0
 @RequestMapping("xiao-inventory")
 public String showInventory(Model model) {
   super.setModelAttributes(model, "xiao-inventory");
   MyAdminUser myAdminUser = (MyAdminUser) securityVerifier.getPersistentAdminUser();
   model.addAttribute(
       "inventorys",
       inventoryService.readInventoryForFulfillmentLocation(myAdminUser.getFulfillmentLocation()));
   return SHOW_INVENTORY;
 }
예제 #2
0
 @ResponseBody
 @RequestMapping("inventory-warn")
 protected List<SkuOfInventoryForm> InventoryWarn(HttpServletRequest request) {
   MyAdminUser myAdminUser = (MyAdminUser) securityVerifier.getPersistentAdminUser();
   List<Inventory> inventoryes =
       inventoryService.readInventoryForLessThanQuantity(
           inventoryThreshold, myAdminUser.getFulfillmentLocation().getId());
   List<SkuOfInventoryForm> skuForms = new ArrayList<SkuOfInventoryForm>();
   for (int i = 0; i < inventoryes.size(); i++) {
     SkuOfInventoryForm skuForm = new SkuOfInventoryForm();
     skuForm.setId(inventoryes.get(i).getSku().getId());
     skuForm.setName(inventoryes.get(i).getSku().getName());
     skuForm.setQuantity(inventoryes.get(i).getQuantityAvailable());
     skuForms.add(skuForm);
   }
   return skuForms;
 }