| | |
| | | package com.ltkj.web.controller.system; |
| | | |
| | | import java.util.Collections; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | |
| | | import cn.hutool.extra.pinyin.PinyinUtil; |
| | | import com.ltkj.common.core.redis.RedisCache; |
| | | import com.ltkj.framework.config.MatchUtils; |
| | | import com.ltkj.hosp.domain.DictHosp; |
| | | import com.ltkj.hosp.domain.DictSfxm; |
| | | import com.ltkj.hosp.domain.TjCustomer; |
| | | import com.ltkj.hosp.service.IDictHospService; |
| | | import com.ltkj.hosp.service.IDictSfxmService; |
| | | import com.ltkj.hosp.service.TjAsyncService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiParam; |
| | |
| | | private IDictSfxmService dictSfxmService; |
| | | @Resource |
| | | private IDictHospService dictHospService; |
| | | @Resource |
| | | private RedisCache redisCache; |
| | | @Resource |
| | | private TjAsyncService asyncService; |
| | | |
| | | /** |
| | | * 查询收费项目列表 |
| | |
| | | @ApiOperation(value = "查询") |
| | | public TableDataInfo list(DictSfxm dictSfxm) { |
| | | startPage(); |
| | | String pym = dictSfxm.getPym(); |
| | | if(null !=pym && !"".equals(pym)) { |
| | | pym=dictSfxm.getPym().toUpperCase(Locale.ROOT); |
| | | dictSfxm.setPym(pym); |
| | | } |
| | | List<DictSfxm> list = dictSfxmService.selectDictSfxmList(dictSfxm); |
| | | if (null != list && list.size() > 0) { |
| | | for (DictSfxm sfxm : list) { |
| | |
| | | @PostMapping |
| | | @ApiOperation(value = "新增") |
| | | public AjaxResult add(@RequestBody DictSfxm dictSfxm) { |
| | | dictSfxm.setWbm(MatchUtils.toWubi(dictSfxm.getXmmc())); |
| | | dictSfxm.setPym(PinyinUtil.getFirstLetter(dictSfxm.getXmmc(),"").toUpperCase(Locale.ROOT)); |
| | | return toAjax(dictSfxmService.insertDictSfxm(dictSfxm)); |
| | | } |
| | | |
| | |
| | | @GetMapping("/getList") |
| | | @ApiOperation(value = "按照项目编码树形查询") |
| | | public AjaxResult getList() { |
| | | asyncService.getDictSfxms(); |
| | | if(redisCache.hasKey("getDictSfxms")){ |
| | | List<DictSfxm> getDictSfxms = redisCache.getCacheList("getDictSfxms"); |
| | | return AjaxResult.success(getDictSfxms); |
| | | } |
| | | List<DictSfxm> dictSfxms = getDictSfxms(); |
| | | return AjaxResult.success(dictSfxms); |
| | | } |
| | | |
| | | private List<DictSfxm> getDictSfxms() { |
| | | List<DictSfxm> dictSfxms = dictSfxmService.getYjDictSfxmList(); |
| | | if (null != dictSfxms && dictSfxms.size() > 0) { |
| | | for (DictSfxm dictSfxm : dictSfxms) { |
| | |
| | | dictSfxm.setDictSfxms(sfxms); |
| | | } |
| | | } |
| | | return AjaxResult.success(dictSfxms); |
| | | return dictSfxms; |
| | | } |
| | | |
| | | |