| | |
| | | @ManagerAuth |
| | | public R edit(BasWrkIotype basWrkIotype) { |
| | | if (Cools.isEmpty(basWrkIotype)){ |
| | | return R.error(); |
| | | return R.error("response.param_error"); |
| | | } |
| | | if (null == basWrkIotype.getIoType()){ |
| | | basWrkIotypeService.insert(basWrkIotype); |
| | | } else { |
| | | basWrkIotypeService.updateById(basWrkIotype); |
| | | } |
| | | return R.ok(); |
| | | return R.ok("response.save_success"); |
| | | } |
| | | |
| | | @RequestMapping(value = "/basWrkIotype/add/auth") |
| | | @ManagerAuth(memo = "入出库类型添加") |
| | | @ManagerAuth(memo = "response.bas_wrk_iotype_add") |
| | | public R add(BasWrkIotype basWrkIotype) { |
| | | basWrkIotype.setModiUser(getUserId()); |
| | | basWrkIotype.setModiTime(new Date()); |
| | | basWrkIotype.setAppeUser(getUserId()); |
| | | basWrkIotype.setAppeTime(new Date()); |
| | | basWrkIotypeService.insert(basWrkIotype); |
| | | return R.ok(); |
| | | return R.ok("response.save_success"); |
| | | } |
| | | |
| | | @RequestMapping(value = "/basWrkIotype/update/auth") |
| | | @ManagerAuth(memo = "入出库类型修改") |
| | | @RequestMapping(value = "/basWrkIotype/update/auth") |
| | | @ManagerAuth(memo = "response.bas_wrk_iotype_update") |
| | | public R update(BasWrkIotype basWrkIotype){ |
| | | if (Cools.isEmpty(basWrkIotype) || null==basWrkIotype.getIoType()){ |
| | | return R.error(); |
| | | return R.error("response.param_error"); |
| | | } |
| | | basWrkIotype.setModiUser(getUserId()); |
| | | basWrkIotype.setModiTime(new Date()); |
| | | basWrkIotypeService.updateById(basWrkIotype); |
| | | return R.ok(); |
| | | return R.ok("response.update_success"); |
| | | } |
| | | |
| | | @RequestMapping(value = "/basWrkIotype/delete/auth") |
| | | @ManagerAuth(memo = "入出库类型删除") |
| | | @ManagerAuth(memo = "response.bas_wrk_iotype_delete") |
| | | public R delete(@RequestParam String param){ |
| | | List<BasWrkIotype> list = JSONArray.parseArray(param, BasWrkIotype.class); |
| | | if (Cools.isEmpty(list)){ |
| | | return R.error(); |
| | | return R.error("response.param_error"); |
| | | } |
| | | for (BasWrkIotype entity : list){ |
| | | basWrkIotypeService.delete(new EntityWrapper<>(entity)); |
| | | } |
| | | return R.ok(); |
| | | return R.ok("response.delete_success"); |
| | | } |
| | | |
| | | @RequestMapping(value = "/basWrkIotype/export/auth") |
| | | @ManagerAuth(memo = "入出库类型导出") |
| | | @ManagerAuth(memo = "response.bas_wrk_iotype_export") |
| | | public R export(@RequestBody JSONObject param){ |
| | | List<String> fields = JSONObject.parseArray(param.getJSONArray("fields").toJSONString(), String.class); |
| | | EntityWrapper<BasWrkIotype> wrapper = new EntityWrapper<>(); |
| | |
| | | public R query(@RequestBody JSONObject param) { |
| | | Wrapper<BasWrkIotype> wrapper = new EntityWrapper<BasWrkIotype>().eq(humpToLine(String.valueOf(param.get("key"))), param.get("val")); |
| | | if (null != basWrkIotypeService.selectOne(wrapper)){ |
| | | return R.parse(BaseRes.REPEAT).add(getComment(BasWrkIotype.class, String.valueOf(param.get("key")))); |
| | | R r = R.parse(BaseRes.REPEAT); |
| | | r.put("data", getComment(BasWrkIotype.class, String.valueOf(param.get("key")))); |
| | | return r; |
| | | } |
| | | return R.ok(); |
| | | } |