mirror of https://github.com/elunez/eladmin
查看所有仓库
parent
6466d75b6a
commit
9dfb94433f
|
@ -4,7 +4,7 @@ import me.zhengjie.aop.log.Log;
|
||||||
import me.zhengjie.exception.BadRequestException;
|
import me.zhengjie.exception.BadRequestException;
|
||||||
import me.zhengjie.modules.wms.bd.domain.WareHouse;
|
import me.zhengjie.modules.wms.bd.domain.WareHouse;
|
||||||
import me.zhengjie.modules.wms.bd.service.WareHouseService;
|
import me.zhengjie.modules.wms.bd.service.WareHouseService;
|
||||||
import me.zhengjie.modules.wms.bd.service.dto.WareHouseDTO;
|
import me.zhengjie.modules.wms.bd.service.dto.WareHouseQueryCriteria;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.data.domain.Pageable;
|
import org.springframework.data.domain.Pageable;
|
||||||
import org.springframework.http.HttpStatus;
|
import org.springframework.http.HttpStatus;
|
||||||
|
@ -48,9 +48,15 @@ public class WareHouseController {
|
||||||
return new ResponseEntity(HttpStatus.OK);
|
return new ResponseEntity(HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Log("查询仓库")
|
@Log("分页查询仓库")
|
||||||
@GetMapping(value = "/wareHouse")
|
@GetMapping(value = "/wareHouse")
|
||||||
public ResponseEntity getDicts(WareHouseDTO resources, Pageable pageable){
|
public ResponseEntity getWareHouses(WareHouseQueryCriteria wareHouseQueryCriteria, Pageable pageable){
|
||||||
return new ResponseEntity(wareHouseService.queryAll(resources,pageable),HttpStatus.OK);
|
return new ResponseEntity(wareHouseService.queryAll(wareHouseQueryCriteria,pageable),HttpStatus.OK);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Log("查询仓库列表")
|
||||||
|
@GetMapping(value = "/wareHouse/all")
|
||||||
|
public ResponseEntity queryWareHouseList(WareHouseQueryCriteria wareHouseQueryCriteria){
|
||||||
|
return new ResponseEntity(wareHouseService.queryAll(wareHouseQueryCriteria),HttpStatus.OK);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,6 +2,7 @@ package me.zhengjie.modules.wms.bd.service;
|
||||||
|
|
||||||
import me.zhengjie.modules.wms.bd.domain.WareHouse;
|
import me.zhengjie.modules.wms.bd.domain.WareHouse;
|
||||||
import me.zhengjie.modules.wms.bd.service.dto.WareHouseDTO;
|
import me.zhengjie.modules.wms.bd.service.dto.WareHouseDTO;
|
||||||
|
import me.zhengjie.modules.wms.bd.service.dto.WareHouseQueryCriteria;
|
||||||
import org.springframework.data.domain.Pageable;
|
import org.springframework.data.domain.Pageable;
|
||||||
|
|
||||||
|
|
||||||
|
@ -17,6 +18,8 @@ public interface WareHouseService {
|
||||||
|
|
||||||
void delete(long id);
|
void delete(long id);
|
||||||
|
|
||||||
Object queryAll(WareHouseDTO wareHouse, Pageable pageable);
|
Object queryAll(WareHouseQueryCriteria wareHouseQueryCriteria, Pageable pageable);
|
||||||
|
|
||||||
|
Object queryAll(WareHouseQueryCriteria wareHouseQueryCriteria);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,6 +5,7 @@ import me.zhengjie.modules.wms.bd.domain.WareHouse;
|
||||||
import me.zhengjie.modules.wms.bd.repository.WareHouseRepository;
|
import me.zhengjie.modules.wms.bd.repository.WareHouseRepository;
|
||||||
import me.zhengjie.modules.wms.bd.service.WareHouseService;
|
import me.zhengjie.modules.wms.bd.service.WareHouseService;
|
||||||
import me.zhengjie.modules.wms.bd.service.dto.WareHouseDTO;
|
import me.zhengjie.modules.wms.bd.service.dto.WareHouseDTO;
|
||||||
|
import me.zhengjie.modules.wms.bd.service.dto.WareHouseQueryCriteria;
|
||||||
import me.zhengjie.modules.wms.bd.service.mapper.WareHouseMapper;
|
import me.zhengjie.modules.wms.bd.service.mapper.WareHouseMapper;
|
||||||
import me.zhengjie.utils.PageUtil;
|
import me.zhengjie.utils.PageUtil;
|
||||||
import me.zhengjie.utils.QueryHelp;
|
import me.zhengjie.utils.QueryHelp;
|
||||||
|
@ -71,9 +72,15 @@ public class WareHouseServiceImpl implements WareHouseService {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Object queryAll(WareHouseDTO wareHouse, Pageable pageable) {
|
public Object queryAll(WareHouseQueryCriteria wareHouseQueryCriteria, Pageable pageable) {
|
||||||
Page<WareHouse> page = wareHouseRepository.findAll((root, query, cb) -> QueryHelp.getPredicate(root, wareHouse, cb), pageable);
|
Page<WareHouse> page = wareHouseRepository.findAll((root, query, cb) -> QueryHelp.getPredicate(root, wareHouseQueryCriteria, cb), pageable);
|
||||||
return PageUtil.toPage(page.map(wareHouseMapper::toDto));
|
return PageUtil.toPage(page.map(wareHouseMapper::toDto));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Object queryAll(WareHouseQueryCriteria wareHouseQueryCriteria) {
|
||||||
|
List<WareHouse> wareHouseList = wareHouseRepository.findAll((root, query, cb) -> QueryHelp.getPredicate(root, wareHouseQueryCriteria, cb));
|
||||||
|
return wareHouseList;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue