|  |  |  | 
|---|
|  |  |  | @RequestMapping(value = "/basWhs/{id}/auth") | 
|---|
|  |  |  | @ManagerAuth | 
|---|
|  |  |  | public R get(@PathVariable("id") String id) { | 
|---|
|  |  |  | return R.ok(basWhsService.getById(String.valueOf(id))); | 
|---|
|  |  |  | return R.ok(basWhsService.getOne(new LambdaQueryWrapper<BasWhs>().eq(BasWhs::getId, Long.parseLong(id)).eq(BasWhs::getHostId, getHostId()))); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @RequestMapping(value = "/basWhs/page/auth") | 
|---|
|  |  |  | 
|---|
|  |  |  | @RequestParam(required = false) String timeRange, | 
|---|
|  |  |  | @RequestParam Map<String, Object> param) { | 
|---|
|  |  |  | LambdaQueryWrapper<BasWhs> wrapper = new LambdaQueryWrapper<>(); | 
|---|
|  |  |  | wrapper.eq(BasWhs::getHostId, getHostId()); | 
|---|
|  |  |  | if (!Cools.isEmpty(condition)) { | 
|---|
|  |  |  | wrapper.like(BasWhs::getWhsDesc, condition); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | @RequestMapping(value = "/basWhs/add/auth") | 
|---|
|  |  |  | @ManagerAuth | 
|---|
|  |  |  | public R add(BasWhs basWhs) { | 
|---|
|  |  |  | basWhs.setHostId(getHostId()); | 
|---|
|  |  |  | basWhsService.save(basWhs); | 
|---|
|  |  |  | return R.ok(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | @ManagerAuth | 
|---|
|  |  |  | public R query(String condition) { | 
|---|
|  |  |  | LambdaQueryWrapper<BasWhs> wrapper = new LambdaQueryWrapper<>(); | 
|---|
|  |  |  | wrapper.eq(BasWhs::getHostId, getHostId()); | 
|---|
|  |  |  | wrapper.like(BasWhs::getWhsDesc, condition); | 
|---|
|  |  |  | Page<BasWhs> page = basWhsService.page(new Page<>(0, 10), wrapper); | 
|---|
|  |  |  | List<Map<String, Object>> result = new ArrayList<>(); | 
|---|
|  |  |  | 
|---|
|  |  |  | public R getDataKV(@RequestParam(required = false) String condition) { | 
|---|
|  |  |  | List<KeyValueVo> vos = new ArrayList<>(); | 
|---|
|  |  |  | LambdaQueryWrapper<BasWhs> wrapper = new LambdaQueryWrapper<>(); | 
|---|
|  |  |  | wrapper.eq(BasWhs::getHostId, getHostId()); | 
|---|
|  |  |  | if (!Cools.isEmpty(condition)) { | 
|---|
|  |  |  | wrapper.like(BasWhs::getWhsDesc, condition); | 
|---|
|  |  |  | } | 
|---|