| | |
| | | } |
| | | |
| | | @RequestMapping(value = "/basWhs/add/auth") |
| | | @ManagerAuth(memo = "库位类型添加") |
| | | @ManagerAuth(memo = "response.warehouse_add") |
| | | public R add(BasWhs basWhs) { |
| | | basWhs.setModiUser(getUserId()); |
| | | basWhs.setModiTime(new Date()); |
| | |
| | | } |
| | | |
| | | @RequestMapping(value = "/basWhs/update/auth") |
| | | @ManagerAuth(memo = "库位类型修改") |
| | | @ManagerAuth(memo = "response.warehouse_update") |
| | | public R update(BasWhs basWhs){ |
| | | if (Cools.isEmpty(basWhs) || null==basWhs.getId()){ |
| | | return R.error(); |
| | |
| | | } |
| | | |
| | | @RequestMapping(value = "/basWhs/delete/auth") |
| | | @ManagerAuth(memo = "库位类型删除") |
| | | @ManagerAuth(memo = "response.warehouse_delete") |
| | | public R delete(@RequestParam String param){ |
| | | List<BasWhs> list = JSONArray.parseArray(param, BasWhs.class); |
| | | if (Cools.isEmpty(list)){ |
| | | return R.error(); |
| | | return R.error("response.select_at_least_one_delete_data"); |
| | | } |
| | | for (BasWhs entity : list){ |
| | | basWhsService.delete(new EntityWrapper<>(entity)); |
| | | } |
| | | return R.ok(); |
| | | return R.ok("response.delete_success"); |
| | | } |
| | | |
| | | @RequestMapping(value = "/basWhs/export/auth") |
| | | @ManagerAuth(memo = "库位类型导出") |
| | | @ManagerAuth(memo = "response.warehouse_export") |
| | | public R export(@RequestBody JSONObject param){ |
| | | List<String> fields = JSONObject.parseArray(param.getJSONArray("fields").toJSONString(), String.class); |
| | | EntityWrapper<BasWhs> wrapper = new EntityWrapper<>(); |
| | |
| | | public R query(@RequestBody JSONObject param) { |
| | | Wrapper<BasWhs> wrapper = new EntityWrapper<BasWhs>().eq(humpToLine(String.valueOf(param.get("key"))), param.get("val")); |
| | | if (null != basWhsService.selectOne(wrapper)){ |
| | | return R.parse(BaseRes.REPEAT).add(getComment(BasWhs.class, String.valueOf(param.get("key")))); |
| | | R r = R.parse(BaseRes.REPEAT); |
| | | r.put("data", getComment(BasWhs.class, String.valueOf(param.get("key")))); |
| | | return r; |
| | | } |
| | | return R.ok(); |
| | | } |