| | |
| | | } |
| | | |
| | | @RequestMapping(value = "/wrkLastno/add/auth") |
| | | @ManagerAuth(memo = "工作序号添加") |
| | | @ManagerAuth(memo = "response.wrk_lastno_add") |
| | | public R add(WrkLastno wrkLastno) { |
| | | wrkLastno.setModiUser(getUserId()); |
| | | wrkLastno.setModiTime(new Date()); |
| | | wrkLastno.setAppeUser(getUserId()); |
| | | wrkLastno.setAppeTime(new Date()); |
| | | wrkLastnoService.insert(wrkLastno); |
| | | return R.ok(); |
| | | return R.ok("response.save_success"); |
| | | } |
| | | |
| | | @RequestMapping(value = "/wrkLastno/update/auth") |
| | | @ManagerAuth(memo = "工作序号修改") |
| | | @ManagerAuth(memo = "response.wrk_lastno_update") |
| | | public R update(WrkLastno wrkLastno){ |
| | | if (Cools.isEmpty(wrkLastno) || null==wrkLastno.getWrkMk()){ |
| | | return R.error(); |
| | | return R.error("response.param_error"); |
| | | } |
| | | wrkLastno.setModiUser(getUserId()); |
| | | wrkLastno.setModiTime(new Date()); |
| | | wrkLastnoService.updateById(wrkLastno); |
| | | return R.ok(); |
| | | return R.ok("response.update_success"); |
| | | } |
| | | |
| | | @RequestMapping(value = "/wrkLastno/delete/auth") |
| | | @ManagerAuth(memo = "工作序号删除") |
| | | @ManagerAuth(memo = "response.wrk_lastno_delete") |
| | | public R delete(@RequestParam String param){ |
| | | List<WrkLastno> list = JSONArray.parseArray(param, WrkLastno.class); |
| | | if (Cools.isEmpty(list)){ |
| | | return R.error(); |
| | | return R.error("response.param_error"); |
| | | } |
| | | for (WrkLastno entity : list){ |
| | | wrkLastnoService.delete(new EntityWrapper<>(entity)); |
| | | } |
| | | return R.ok(); |
| | | return R.ok("response.delete_success"); |
| | | } |
| | | |
| | | @RequestMapping(value = "/wrkLastno/export/auth") |
| | | @ManagerAuth(memo = "工作序号导出") |
| | | @ManagerAuth(memo = "response.wrk_lastno_export") |
| | | public R export(@RequestBody JSONObject param){ |
| | | List<String> fields = JSONObject.parseArray(param.getJSONArray("fields").toJSONString(), String.class); |
| | | EntityWrapper<WrkLastno> wrapper = new EntityWrapper<>(); |
| | |
| | | public R query(@RequestBody JSONObject param) { |
| | | Wrapper<WrkLastno> wrapper = new EntityWrapper<WrkLastno>().eq(humpToLine(String.valueOf(param.get("key"))), param.get("val")); |
| | | if (null != wrkLastnoService.selectOne(wrapper)){ |
| | | return R.parse(BaseRes.REPEAT).add(getComment(WrkLastno.class, String.valueOf(param.get("key")))); |
| | | R r = R.parse(BaseRes.REPEAT); |
| | | r.put("data", getComment(WrkLastno.class, String.valueOf(param.get("key")))); |
| | | return r; |
| | | } |
| | | return R.ok(); |
| | | } |