From 0f758679a7018970c8a0b9b83e9e2f158e007a07 Mon Sep 17 00:00:00 2001 From: zjh <1084500556@qq.com> Date: 星期五, 20 十月 2023 16:42:28 +0800 Subject: [PATCH] zjh 2023/10/20--2 --- ltkj-admin/src/main/java/com/ltkj/web/controller/service/TjSysAsyncServiceImpl.java | 80 ++++++++++++++++++++++++++++++++++++++-- 1 files changed, 76 insertions(+), 4 deletions(-) diff --git a/ltkj-admin/src/main/java/com/ltkj/web/controller/service/TjSysAsyncServiceImpl.java b/ltkj-admin/src/main/java/com/ltkj/web/controller/service/TjSysAsyncServiceImpl.java index f241401..0efc496 100644 --- a/ltkj-admin/src/main/java/com/ltkj/web/controller/service/TjSysAsyncServiceImpl.java +++ b/ltkj-admin/src/main/java/com/ltkj/web/controller/service/TjSysAsyncServiceImpl.java @@ -7,6 +7,7 @@ import com.ltkj.common.core.domain.entity.SysUser; import com.ltkj.common.core.redis.RedisCache; import com.ltkj.common.utils.StringUtils; +import com.ltkj.framework.config.MatchUtils; import com.ltkj.hosp.domain.*; import com.ltkj.hosp.service.*; import com.ltkj.hosp.vodomain.AddNewReservationConfirm; @@ -81,6 +82,14 @@ private ITjAdviceService tjAdviceService; @Resource private ISysUserService userService; + @Resource + private IJimuOnlineReportService reportService; + @Resource + private ITjDwDeptService dwDeptService; + @Resource + private ITjPrintOrderService printOrderService; + @Resource + private IDictSfxmService dictSfxmService; @Override @@ -905,12 +914,75 @@ @Override @Async("async") - public void addRedis(List<TjCustomer> customers) { - for (TjCustomer customer : customers) { - redisCache.setCacheMapValue("updateCheckType"+customer.getTjNumber(),customer.getTjNumber(),getAjaxResult(customer.getTjNumber())); - } + public void getPrintOrderList(List<TjOrder> list) { + + redisCache.setCacheMapValue("getPrintOrderList","0",extracted(0, list)); + redisCache.setCacheMapValue("getPrintOrderList","1",extracted(1, list)); + } + @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) { + TjCustomer tjCustomer = tjCustomerService.selectTjCustomerByCusId(order.getUserId()); + if (null != tjCustomer) { + order.setTjCustomerSex(tjCustomer.getCusSex()); + order.setTjCustomerAge(DateUtil.ageOfNow(tjCustomer.getCusBrithday())); + order.setGrMoBanId(reportService.getGrMoBanIds()); + order.setTjCustomerName(MatchUtils.hideCusName(tjCustomer.getCusName())); + if(null!=tjCustomer.getCusPhone())order.setTjCustomerPhone(MatchUtils.hidePhoneNum(tjCustomer.getCusPhone())); + if(null!=tjCustomer.getCusIdcard())order.setTjCusIdCard(MatchUtils.hideIdCardNum(tjCustomer.getCusIdcard())); + } + String firmId = order.getFirmId(); + if (firmId != null && null != compService.selectDictCompByDrugManufacturerId(String.valueOf(order.getFirmId()))) { + order.setDictCompName(compService.selectDictCompByDrugManufacturerId(String.valueOf(order.getFirmId())).getCnName()); + } + if (null != order.getPacId()) { + if (null != tjPackageService.getById(order.getPacId())) { + order.setPacName(tjPackageService.getById(order.getPacId()).getPacName()); + } + if (null != dwDeptService.getById(order.getPacId())) { + order.setPacName(dwDeptService.getById(order.getPacId()).getDwDeptName()); + } + } + //浠庢墦鍗拌褰曟煡鍑烘渶鏂版墦鍗版椂闂� + TjPrintOrder one = printOrderService.getTjPrintOrderByTjNum(order.getTjNumber()); + if (null != type && type == 1 && one != null) { + order.setPrintTime(one.getCreateTime()); + order.setPrintName(one.getCreateBy()); + order.setType(1); + list1.add(order); + } + if (null != type && type == 0 && one == null) { + order.setType(0); + list1.add(order); + } + } + return list1; + } private void getTjPackageListsByMan(List<TjPackage> tjPackageList) { if (null != tjPackageList && tjPackageList.size() > 0) { for (TjPackage aPackage : tjPackageList) { -- Gitblit v1.8.0