| | |
| | | } |
| | | |
| | | @RequestMapping(value = "/basCrnp/add/auth") |
| | | @ManagerAuth(memo = "堆垛机添加") |
| | | @ManagerAuth(memo = "response.crane_add") |
| | | public R add(BasCrnp basCrnp) { |
| | | basCrnp.setModiUser(getUserId()); |
| | | basCrnp.setModiTime(new Date()); |
| | | basCrnp.setAppeUser(getUserId()); |
| | | basCrnp.setAppeTime(new Date()); |
| | | basCrnpService.insert(basCrnp); |
| | | return R.ok(); |
| | | return R.ok("response.save_success"); |
| | | } |
| | | |
| | | @RequestMapping(value = "/basCrnp/update/auth") |
| | | @ManagerAuth(memo = "堆垛机修改") |
| | | @ManagerAuth(memo = "response.crane_update") |
| | | public R update(BasCrnp basCrnp){ |
| | | if (Cools.isEmpty(basCrnp) || null==basCrnp.getCrnNo()){ |
| | | return R.error(); |
| | | return R.error("response.param_error"); |
| | | } |
| | | basCrnp.setModiUser(getUserId()); |
| | | basCrnp.setModiTime(new Date()); |
| | | basCrnpService.updateById(basCrnp); |
| | | return R.ok(); |
| | | return R.ok("response.update_success"); |
| | | } |
| | | |
| | | @RequestMapping(value = "/basCrnp/delete/auth") |
| | | @ManagerAuth(memo = "堆垛机删除") |
| | | @ManagerAuth(memo = "response.crane_delete") |
| | | public R delete(@RequestParam String param){ |
| | | List<BasCrnp> list = JSONArray.parseArray(param, BasCrnp.class); |
| | | if (Cools.isEmpty(list)){ |
| | | return R.error(); |
| | | return R.error("response.param_error"); |
| | | } |
| | | for (BasCrnp entity : list){ |
| | | basCrnpService.delete(new EntityWrapper<>(entity)); |
| | | } |
| | | return R.ok(); |
| | | return R.ok("response.delete_success"); |
| | | } |
| | | |
| | | @RequestMapping(value = "/basCrnp/export/auth") |
| | | @ManagerAuth(memo = "堆垛机导出") |
| | | @ManagerAuth(memo = "response.crane_export") |
| | | public R export(@RequestBody JSONObject param){ |
| | | List<String> fields = JSONObject.parseArray(param.getJSONArray("fields").toJSONString(), String.class); |
| | | EntityWrapper<BasCrnp> wrapper = new EntityWrapper<>(); |
| | |
| | | public R query(@RequestBody JSONObject param) { |
| | | Wrapper<BasCrnp> wrapper = new EntityWrapper<BasCrnp>().eq(humpToLine(String.valueOf(param.get("key"))), param.get("val")); |
| | | if (null != basCrnpService.selectOne(wrapper)){ |
| | | return R.parse(BaseRes.REPEAT).add(getComment(BasCrnp.class, String.valueOf(param.get("key")))); |
| | | R r = R.parse(BaseRes.REPEAT); |
| | | r.put("data", getComment(BasCrnp.class, String.valueOf(param.get("key")))); |
| | | return r; |
| | | } |
| | | return R.ok(); |
| | | } |