| | |
| | | @PostMapping |
| | | @ApiOperation(value = "新增") |
| | | public AjaxResult add(@RequestBody DictSfxm dictSfxm) { |
| | | asyncService.getDictSfxms(); |
| | | dictSfxm.setWbm(MatchUtils.toWubi(dictSfxm.getXmmc())); |
| | | dictSfxm.setPym(PinyinUtil.getFirstLetter(dictSfxm.getXmmc(),"").toUpperCase(Locale.ROOT)); |
| | | return toAjax(dictSfxmService.insertDictSfxm(dictSfxm)); |
| | |
| | | @PutMapping |
| | | @ApiOperation(value = "修改") |
| | | public AjaxResult edit(@RequestBody DictSfxm dictSfxm) { |
| | | asyncService.getDictSfxms(); |
| | | return toAjax(dictSfxmService.updateDictSfxm(dictSfxm)); |
| | | } |
| | | |
| | |
| | | @DeleteMapping("/{ids}") |
| | | @ApiOperation(value = "删除") |
| | | public AjaxResult remove(@PathVariable Long[] ids) { |
| | | asyncService.getDictSfxms(); |
| | | return toAjax(dictSfxmService.deleteDictSfxmByIds(ids)); |
| | | } |
| | | |
| | |
| | | @GetMapping("/getList") |
| | | @ApiOperation(value = "按照项目编码树形查询") |
| | | public AjaxResult getList() { |
| | | asyncService.getDictSfxms(); |
| | | if(redisCache.hasKey("getDictSfxms")){ |
| | | List<DictSfxm> getDictSfxms = redisCache.getCacheList("getDictSfxms"); |
| | | return AjaxResult.success(getDictSfxms); |