ltkj-admin/src/main/java/com/ltkj/web/controller/service/TjSysAsyncServiceImpl.java
@@ -88,6 +88,8 @@ private ITjDwDeptService dwDeptService; @Resource private ITjPrintOrderService printOrderService; @Resource private IDictSfxmService dictSfxmService; @Override @@ -919,6 +921,29 @@ } @Override @Async("async") public void getDictSfxms() { List<DictSfxm> dictSfxm = getDictSfxm(); redisCache.setCacheObject("getDictSfxms",dictSfxm); } private List<DictSfxm> getDictSfxm() { List<DictSfxm> dictSfxms = dictSfxmService.getYjDictSfxmList(); if (null != dictSfxms && dictSfxms.size() > 0) { for (DictSfxm dictSfxm : dictSfxms) { List<DictSfxm> sfxms = dictSfxmService.getEjDictSfxmList(dictSfxm.getId()); if (null != sfxms && sfxms.size() > 0) { for (DictSfxm sfxm : sfxms) { List<DictSfxm> sfx = dictSfxmService.getSjDictSfxmList(dictSfxm.getId()); sfxm.setDictSfxms(sfx); } } dictSfxm.setDictSfxms(sfxms); } } return dictSfxms; } private List<TjOrder> extracted(Integer type, List<TjOrder> list) { List<TjOrder> list1=new ArrayList<>(); for (TjOrder order : list) { @@ -958,7 +983,6 @@ } return list1; } private void getTjPackageListsByMan(List<TjPackage> tjPackageList) { if (null != tjPackageList && tjPackageList.size() > 0) { for (TjPackage aPackage : tjPackageList) { ltkj-admin/src/main/java/com/ltkj/web/controller/system/DictSfxmController.java
@@ -6,12 +6,14 @@ 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; @@ -40,6 +42,10 @@ private IDictSfxmService dictSfxmService; @Resource private IDictHospService dictHospService; @Resource private RedisCache redisCache; @Resource private TjAsyncService asyncService; /** * 查询收费项目列表 @@ -128,6 +134,16 @@ @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) { @@ -141,7 +157,7 @@ dictSfxm.setDictSfxms(sfxms); } } return AjaxResult.success(dictSfxms); return dictSfxms; } ltkj-hosp/src/main/java/com/ltkj/hosp/service/TjAsyncService.java
@@ -79,5 +79,9 @@ // void addRedis(List<TjCustomer> customers); //体检发票打印 void getPrintOrderList(List<TjOrder> list); //收费项目按照项目编码树形查询 void getDictSfxms(); }