| | |
| | | import com.matrix.system.hive.dao.SysShopInfoDao; |
| | | import com.matrix.system.hive.service.ShoppingGoodsService; |
| | | import com.matrix.system.hive.service.SysShopInfoService; |
| | | import org.apache.poi.ss.formula.functions.T; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.ui.ModelMap; |
| | |
| | | public @ResponseBody |
| | | AjaxResult showList(ShoppingGoods shoppingGoods, PaginationVO pageVo) { |
| | | QueryUtil.setQueryLimit(shoppingGoods); |
| | | pageVo.setOrder("desc"); |
| | | pageVo.setSort("createTime"); |
| | | if(StringUtils.isBlank(pageVo.getSort())){ |
| | | pageVo.setOrder("desc"); |
| | | pageVo.setSort("createTime"); |
| | | } |
| | | |
| | | //2表示查询总部产品 |
| | | if (shoppingGoods.getHeadquarters()!=null && 2==shoppingGoods.getHeadquarters()) { |
| | | //仅查询本店产品 |
| | | SysShopInfo zbShop = shopInfoDao.selectZbShop(getMe().getCompanyId()); |
| | | //如果是总部自己查询自己的库存则不需加入这个调价 |
| | | if (getMe().getShopId().equals(zbShop.getId())){ |
| | | shoppingGoods.setHeadquarters(1); |
| | | } |
| | | } |
| | | shoppingGoods.setIsDel(ShoppingGoods.NORMAL); |
| | | shoppingGoods.setStaus(Dictionary.BUSINESS_STATE_UP); |
| | | List<ShoppingGoods> dataList = shoppingGoodsService.findInPage(shoppingGoods, pageVo); |
| | | AjaxResult result = new AjaxResult(AjaxResult.STATUS_SUCCESS, dataList, shoppingGoodsService.findTotal(shoppingGoods)); |
| | | return result; |
| | | |
| | | } |
| | | |
| | | @RequestMapping(value = "/showAllList") |
| | | @ResponseBody |
| | | public AjaxResult showAllList(ShoppingGoods shoppingGoods, PaginationVO pageVo) { |
| | | QueryUtil.setQueryLimit(shoppingGoods); |
| | | if(StringUtils.isBlank(pageVo.getSort())){ |
| | | pageVo.setOrder("desc"); |
| | | pageVo.setSort("createTime"); |
| | | } |
| | | |
| | | //2表示查询总部产品 |
| | | if (shoppingGoods.getHeadquarters()!=null && 2==shoppingGoods.getHeadquarters()) { |
| | | //仅查询本店产品 |
| | |
| | | List<ShoppingGoods> dataList = shoppingGoodsService.findInPage(shoppingGoods, pageVo); |
| | | AjaxResult result = new AjaxResult(AjaxResult.STATUS_SUCCESS, dataList, shoppingGoodsService.findTotal(shoppingGoods)); |
| | | return result; |
| | | |
| | | } |
| | | |
| | | @RequestMapping(value = "/showListShopId") |