接口&调用接口

接口:

    /**
     * 分页查询
     * @param request
     * @param pageable
     * @return
     */
    @GetMapping("/query-baseProductBuyPrice")
    public ResponseEntity<Page<BaseProductBuyPriceDto>> queryBaseProductBuyPricePageDatas(HttpServletRequest request, Pageable pageable);

实现类:

    @Override
    public ResponseEntity<Page<BaseProductBuyPriceDto>> queryBaseProductBuyPricePageDatas(HttpServletRequest request, Pageable pageable) {
        try{
            Map<String, Object> searchParams = new HashMap<String, Object>();
            String ts = request.getParameter("ts");
            if(StringUtils.isNotBlank(ts)){
                Date date = new Date( Long.parseLong(ts));
                searchParams.put("GTE_1~ts", date);
                searchParams.put("GTE_1~provider.ts", date);
            }
            searchParams.put("NOTEQ_isEnable", 0);
            Page<BaseProductBuyPriceDto> fabSchemeDtoPages = baseProductBuyPriceService.findAll(searchParams,pageable,true);
            return HeaderUtil.createInfoResponse(null, fabSchemeDtoPages);
        }catch (Exception e){
            return HeaderUtil.createErrorResponse(e.getMessage(), null);
        }
    }

调用接口:

http://10.10.10.10/occ-mdm/api/mdm/BaseProductBuyPrice/query-baseProductBuyPrice?ts=1568610029000&page=0&size=300

  

posted @ 2019-09-16 17:19  唐胜伟  阅读(302)  评论(0编辑  收藏  举报