| | |
| | | docType.setUpdateBy(getUserId()); |
| | | docType.setUpdateTime(new Date()); |
| | | docTypeService.insert(docType); |
| | | return R.ok(); |
| | | return R.ok("response.save_success"); |
| | | } |
| | | |
| | | @RequestMapping(value = "/docType/update/auth") |
| | | @ManagerAuth |
| | | public R update(DocType docType){ |
| | | if (Cools.isEmpty(docType) || null==docType.getDocId()){ |
| | | return R.error(); |
| | | return R.error("response.param_error"); |
| | | } |
| | | docType.setUpdateBy(getUserId()); |
| | | docType.setUpdateTime(new Date()); |
| | | docTypeService.updateById(docType); |
| | | return R.ok(); |
| | | return R.ok("response.update_success"); |
| | | } |
| | | |
| | | @RequestMapping(value = "/docType/delete/auth") |
| | |
| | | for (Long id : ids){ |
| | | docTypeService.deleteById(id); |
| | | } |
| | | return R.ok(); |
| | | return R.ok("response.delete_success"); |
| | | } |
| | | |
| | | @RequestMapping(value = "/docType/export/auth") |
| | |
| | | public R query(String condition) { |
| | | EntityWrapper<DocType> wrapper = new EntityWrapper<>(); |
| | | wrapper.like("doc_name", condition); |
| | | Page<DocType> page = docTypeService.selectPage(new Page<>(0, 10), wrapper); |
| | | wrapper.eq("status", 1); |
| | | Page<DocType> page = docTypeService.selectPage(new Page<>(0, 30), wrapper); |
| | | List<Map<String, Object>> result = new ArrayList<>(); |
| | | for (DocType docType : page.getRecords()){ |
| | | Map<String, Object> map = new HashMap<>(); |