| | |
| | | * 查询收费项目列表 |
| | | */ |
| | | // @PreAuthorize("@ss.hasPermi('system:sfxm:list')") |
| | | @GetMapping("/list") |
| | | @PostMapping("/list") |
| | | @ApiOperation(value = "查询") |
| | | public TableDataInfo list(DictSfxm dictSfxm) { |
| | | public TableDataInfo list(@RequestBody DictSfxm dictSfxm) { |
| | | startPage(); |
| | | String pym = dictSfxm.getPym(); |
| | | if(null !=pym && !"".equals(pym)) { |
| | |
| | | @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"); |
| | | List<DictSfxm> getDictSfxms = redisCache.getCacheObject("getDictSfxms"); |
| | | return AjaxResult.success(getDictSfxms); |
| | | } |
| | | List<DictSfxm> dictSfxms = getDictSfxms(); |
| | |
| | | List<DictSfxm> sfx = dictSfxmService.getSjDictSfxmList(service.getId()); |
| | | if (null != sfx && sfx.size() > 0) { |
| | | List<DictSfxm> sfxmList = sfx.stream().skip((long) (page - 1) * pageSize).limit(pageSize).collect(Collectors.toList()); |
| | | if (null != sfxmList && sfxmList.size() > 0) { |
| | | for (DictSfxm sfxm : sfxmList) { |
| | | DictHosp hosp = dictHospService.getById(sfxm.getYqid()); |
| | | if (null != hosp) { |
| | | sfxm.setYqName(hosp.getHospAreaName()); |
| | | } |
| | | } |
| | | } |
| | | Collections.reverse(sfxmList); |
| | | map.put("date", sfxmList); |
| | | map.put("total", sfx.size()); |