From 2a9583fd376451ca77a0400af7f3a02d1b80e7f5 Mon Sep 17 00:00:00 2001 From: zhaowenxuan <chacca165@163.com> Date: 星期二, 24 六月 2025 18:04:34 +0800 Subject: [PATCH] 2025-06-24 --- ltkj-admin/src/main/java/com/ltkj/web/controller/system/SysConfigController.java | 181 ++++++++++++++++++++++++++++++++++---------- 1 files changed, 139 insertions(+), 42 deletions(-) diff --git a/ltkj-admin/src/main/java/com/ltkj/web/controller/system/SysConfigController.java b/ltkj-admin/src/main/java/com/ltkj/web/controller/system/SysConfigController.java index e1aed80..e46ac4d 100644 --- a/ltkj-admin/src/main/java/com/ltkj/web/controller/system/SysConfigController.java +++ b/ltkj-admin/src/main/java/com/ltkj/web/controller/system/SysConfigController.java @@ -3,10 +3,12 @@ import java.text.SimpleDateFormat; import java.util.*; import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import cn.hutool.core.date.DateTime; import cn.hutool.core.date.DateUtil; +import cn.hutool.core.util.StrUtil; import cn.hutool.extra.pinyin.PinyinUtil; import cn.hutool.json.JSONUtil; import com.ltkj.common.core.domain.entity.SysMenu; @@ -14,6 +16,7 @@ import com.ltkj.framework.datasource.DynamicDataSourceContextHolder; import com.ltkj.hosp.domain.DictHosp; import com.ltkj.hosp.domain.TjJcycxm; +import com.ltkj.hosp.domain.TjOrder; import com.ltkj.hosp.domain.TjProject; import com.ltkj.hosp.mapper.TestMapper; import com.ltkj.hosp.service.*; @@ -192,23 +195,23 @@ @GetMapping ("/shoudongtbjyjcwsxmjg") @ApiOperation(value = "鎵嬪姩鍚屾妫�楠屾鏌ュ閫侀」鐩粨鏋滄帴鍙�") public AjaxResult shoudongtbjyjcwsxmjg(@RequestParam @ApiParam(value = "jy妫�楠� jc妫�鏌� jyjc妫�楠屽拰妫�鏌�") String tblx, - @ApiParam(value = "浣撴鍙�")@RequestParam String tjh) { - - log.info("鎵嬪姩鍚屾妫�楠屾垨妫�鏌ョ粨鏋滃紑濮�->{}",DateUtil.format(new Date(),"yyyy-MM-dd HH:mm:ss")); + @ApiParam(value = "浣撴鍙�")@RequestParam String tjh, HttpServletRequest request) { + String hospId = request.getHeader("hospId"); + log.info("鎵嬪姩鍚屾妫�楠屾垨妫�鏌ョ粨鏋滃紑濮�->{}{}",hospId,DateUtil.format(new Date(),"yyyy-MM-dd HH:mm:ss")); try { switch (tblx){ case "jy": - tbjianyan(tjh); + tbjianyan(tjh,hospId); log.info("褰撳墠鍚屾鐨勬槸->{} 缁撴灉","妫�楠�"); break; case "jc": - tbjiancha(tjh); + tbjiancha(tjh,hospId); log.info("褰撳墠鍚屾鐨勬槸->{} 缁撴灉","妫�鏌�"); break; case "jyjc": - tbjianyan(tjh); - tbjiancha(tjh); + tbjianyan(tjh,hospId); + tbjiancha(tjh,hospId); log.info("褰撳墠鍚屾鐨勬槸->{} 缁撴灉","妫�楠屾鏌�"); break; default: @@ -228,8 +231,27 @@ return AjaxResult.success(); } - private void tbjianyan(String s) { + private void tbjianyan(String s,String hosp) { try { + + String isWsByView = configService.selectConfigByKey("is_ws_by_view"); + if (StrUtil.isNotBlank(isWsByView) && isWsByView.equals("Y")){ + List<LtkjHysqd> sqd = testMapper.getWsHySqdByView(s); + if (sqd != null && !sqd.isEmpty()){ + for (LtkjHysqd hysqd : sqd) { + LtkjHysqd jybgid = ltkjHysqdService.getLtkjHysqdByTjhAndTmh(hysqd.getTjh(), hysqd.getTmh()); + if (null != jybgid) { + ltkjHysqdService.deletedLtkjHysqdByTjhAndTmh(hysqd.getTjh(), hysqd.getTmh()); + ltkjHybgdService.deletedLtkjHybgdByTjhAndTmh(hysqd.getTmh()); + } + if (ltkjHysqdService.save(hysqd)) { + List<LtkjHybgd> wsbg = testMapper.getWsHyBgdByView(hysqd.getTmh()); + ltkjHybgdService.saveBatch(wsbg); + } + } + } + } + List<Aws> awsList = testMapper.getWsxmLtkjHysqdByLisViBySLAVEWS(s); if(null !=awsList && !awsList.isEmpty()){ log.info("澶栭�侀」鐩釜鏁�->{} 缁撴灉",awsList.size()); @@ -239,7 +261,7 @@ awsService.saveBatch(awsList); log.info("淇濆瓨澶栭�侀」鐩垚鍔�"); } - List<LtkjHysqd> hysqdList = testMapper.getCcXZxYyLtkjHysqdByLisVi(s); + List<LtkjHysqd> hysqdList = testMapper.getCcXZxYyLtkjHysqdByLisVi(s,hosp); log.info("鍘焗ysqdList->{} 缁撴灉", JSONUtil.parseObj(hysqdList)); List<LtkjHysqd> wssq = testMapper.getWsxmLtkjHysqdByLisVi(s); if(null !=wssq && !wssq.isEmpty()){ @@ -272,22 +294,24 @@ } - private void tbjiancha(String s) { + private void tbjiancha(String s,String hosp) { String yqbm = configService.selectConfigByKey("common_api_service_hospbm"); try { - List<LtkjExamJcsqd> jcsqdList = testMapper.getCcXZxYyPacsLtkjExamJcsqd(s); + List<LtkjExamJcsqd> jcsqdList = testMapper.getCcXZxYyPacsLtkjExamJcsqd(s,hosp); + log.info("鎵嬪姩鍚屾妫�鏌ョ敵璇峰崟鏁版嵁:"+jcsqdList); if (null != jcsqdList && !jcsqdList.isEmpty()) { DynamicDataSourceContextHolder.clearDataSourceType(); jcsqdService.deletedLtkjJcsqdByTjhAndTmh(s); jcbgdService.deletedLtkjJcbgdByTjhAndTmh(s); jcsqdService.saveBatch(jcsqdList); - List<LtkjExamJcbgd> jcbgdList = testMapper.getCcXZxYyPacsLtkjExamJcbgd(s); - DynamicDataSourceContextHolder.clearDataSourceType(); + List<LtkjExamJcbgd> jcbgdList = testMapper.getCcXZxYyPacsLtkjExamJcbgd(s,hosp); +// DynamicDataSourceContextHolder.clearDataSourceType(); + log.info("鎵嬪姩鍚屾妫�鏌ユ姤鍛婂崟鏁版嵁:"+jcbgdList); if (null != jcbgdList && !jcbgdList.isEmpty()) jcbgdService.saveBatch(jcbgdList); + jcycxmService.deletedByTjh(s); for (LtkjExamJcsqd jcsqd : jcsqdList) { if(StringUtil.isNotBlank(jcsqd.getJgzt())){ String[] split = jcsqd.getJgzt().replaceAll("\n", "").split("銆倈锛泑;"); - jcycxmService.deletedByTjh(s); for (String jg : split) { if(StringUtil.isNotBlank(jg) && !jg.contains("鏈寮傚父") && !jg.contains("鏈鏄庢樉寮傚父") && !jg.contains("鏈鍗犱綅") && !jg.contains("鏈") @@ -314,6 +338,46 @@ } } + + @GetMapping ("/chaxunjyjcwsxmjg") + @ApiOperation(value = "鏌ヨ妫�楠屾鏌ラ」鐩粨鏋滄帴鍙�") + public AjaxResult chaxunjyjcwsxmjg(@RequestParam @ApiParam(value = "jy妫�楠� jc妫�鏌� jyjc妫�楠屽拰妫�鏌�") String tblx, + @ApiParam(value = "浣撴鍙�")@RequestParam String tjh, HttpServletRequest request) { + String hospId = request.getHeader("hospId"); + log.info("鎵嬪姩鏌ヨ妫�楠屾垨妫�鏌ョ粨鏋滃紑濮�->{}{}",hospId,DateUtil.format(new Date(),"yyyy-MM-dd HH:mm:ss")); + try { + + switch (tblx){ + case "jy": + List<Map<String, Object>> hysqdList = testMapper.sysgetCcXZxYyLtkjHysqdByLisVi(tjh,hospId); + if (null != hysqdList && !hysqdList.isEmpty()) { + for (Map<String, Object> map : hysqdList) { + List<Map<String, Object>> hybgdList = testMapper.sysgetCcXZxYyLtkjHybgdByLisVi(map.get("鏉$爜鍙�").toString()); + map.put("jybgd",hybgdList); + } + DynamicDataSourceContextHolder.clearDataSourceType(); + } + + log.info("褰撳墠鏌ヨ鐨勬槸->{} 缁撴灉","妫�楠�"); + return AjaxResult.success(hysqdList); + + case "jc": + List<Map<String, Object>> jcsqdList = testMapper.sysgetCcXZxYyPacsLtkjExamJcsqd(tjh,hospId); + DynamicDataSourceContextHolder.clearDataSourceType(); + log.info("褰撳墠鏌ヨ鐨勬槸->{} 缁撴灉","妫�鏌�"); + return AjaxResult.success(jcsqdList); + default: + log.info("娌℃湁鎵惧埌鎵�鍖归厤鐨勫悓姝ョ被鍨�"); +// return AjaxResult.error("娌℃湁鎵惧埌鎵�鍖归厤鐨勫悓姝ョ被鍨�!"); + } + log.info("鎵嬪姩鏌ヨ妫�楠屾垨妫�鏌ョ粨鏋滃紑濮�->{}",DateUtil.format(new Date(),"yyyy-MM-dd HH:mm:ss")); + return AjaxResult.error("娌℃湁鎵惧埌鎵�鍖归厤鐨勫悓姝ョ被鍨�!"); + + } catch (Exception e) { + log.error(String.valueOf(e)); + return AjaxResult.error(); + } + } @@ -366,41 +430,74 @@ @GetMapping ("/tjjcycxm")//鍚屾his椤圭洰鍗曚环淇℃伅 -// @PreAuthorize("@ss.hasPermi('system:config:tbhisproprice')") @ApiOperation (value = "tjjcycxm") - public AjaxResult tjjcycxm() { - String yqbm = configService.selectConfigByKey("common_api_service_hospbm"); - List<String> jc = orderService.getJianChaTjNum(); - if (null != jc && !jc.isEmpty()) { - for (String s : jc) { - jcycxmService.deletedByTjh(s); - List<LtkjExamJcsqd> list = jcsqdService.getLtkjJcsqdByTjh(s); - if(null !=list && !list.isEmpty()){ - for (LtkjExamJcsqd jcsqd : list) { - if(StringUtil.isNotBlank(jcsqd.getJgzt())){ + public AjaxResult tjjcycxm(@ApiParam("浣撴鍙�") @RequestParam(required = false)String tjh) { + String yqbm = configService.selectConfigByKey("dqyyyqbm"); + if(StringUtil.isNotBlank(tjh)){ + extracted(tjh, yqbm); + }else { + List<String> jc = orderService.getJianChaTjNum(); + if (null != jc && !jc.isEmpty()) { + for (String s : jc) { + extracted(s, yqbm); + } + } + } + return AjaxResult.success(); + } - String[] split = jcsqd.getJgzt().replaceAll("\n", "").split("銆倈锛泑;"); - for (String jg : split) { - if(StringUtil.isNotBlank(jg) && !jg.contains("鏈寮傚父") - && !jg.contains("鏈鏄庢樉寮傚父") && !jg.contains("鏈鍗犱綅") && !jg.contains("鏈") - && !jg.contains("鏈鏄庢樉")&& !jg.contains("姝e父")&& !jg.contains("鍙屼晶妞庨棿瀛旀棤鐙獎")&& !jg.contains("鏃犳畩")){ - TjJcycxm jcycxm=new TjJcycxm(); - jcycxm.setTjh(s); - jcycxm.setYqid(yqbm); - String[] split1 = jcsqd.getJcxmid().split(";"); - jcycxm.setProId(split1[0]); - jcycxm.setProName(jcsqd.getJcxmmc()); - jcycxm.setCreateTime(new Date()); - jcycxm.setJcjg(jg); - jcycxmService.save(jcycxm); - } - } + private void extracted(String s, String yqbm) { + TjOrder order = orderService.getOrderByTjNum(s); + jcycxmService.deletedByTjh(order.getCardId()); + List<LtkjExamJcsqd> list = jcsqdService.getLtkjJcsqdByTjh(order.getCardId()); + if(null !=list && !list.isEmpty()){ + for (LtkjExamJcsqd jcsqd : list) { + if(StringUtil.isNotBlank(jcsqd.getJgzt())){ + String regex = configService.selectConfigByKey("jcycxmzz"); + if(StringUtil.isBlank(regex)) regex= "銆倈锛泑;|,|锛�"; + System.out.println("jcycxmzz鍊间负"+regex); + String[] split = jcsqd.getJgzt().replaceAll("\n", "").split(regex); + for (String jg : split) { + if(StringUtil.isNotBlank(jg) && !jg.contains("鏈寮傚父") + && !jg.contains("鏈鏄庢樉寮傚父") && !jg.matches("\\d+") && !jg.contains("鏈鍗犱綅") && !jg.contains("鏈") + && !jg.contains("鏈鏄庢樉")&& !jg.contains("姝e父")&& !jg.contains("鍙屼晶妞庨棿瀛旀棤鐙獎")&& !jg.contains("鏃犳畩")){ + TjJcycxm jcycxm=new TjJcycxm(); + jcycxm.setTjh(s); + jcycxm.setYqid(yqbm); + String[] split1 = jcsqd.getJcxmid().split(";"); + jcycxm.setProId(split1[0]); + jcycxm.setProName(jcsqd.getJcxmmc()); + jcycxm.setCreateTime(new Date()); + jcycxm.setJcjg(jg); + jcycxmService.save(jcycxm); } } } - } } + } + + + @GetMapping ("/shoudongtbjcbgdsj") + @ApiOperation(value = "鎵嬪姩鍚屾妫�鏌ユ姤鍛婂崟缁撴灉鎺ュ彛") + public AjaxResult shoudongtbjcbgdsj(HttpServletRequest request) { + String hospId = request.getHeader("hospId"); + log.info("鎵嬪姩鍚屾妫�楠屾垨妫�鏌ョ粨鏋滃紑濮�->{}{}",hospId,DateUtil.format(new Date(),"yyyy-MM-dd HH:mm:ss")); + try { + List<String> jc = orderService.shoudongtbjcbgdsj(); + for (String s : jc) { + jcbgdService.deletedLtkjJcbgdByTjhAndTmh(s); + List<LtkjExamJcbgd> jcbgdList = testMapper.getCcXZxYyPacsLtkjExamJcbgd(s,hospId); + log.info("鎵嬪姩鍚屾妫�鏌ユ姤鍛婂崟鏁版嵁:"+jcbgdList); + if (null != jcbgdList && !jcbgdList.isEmpty()) jcbgdService.saveBatch(jcbgdList); + } + + log.info("褰撳墠鍚屾鐨勬槸->{} 缁撴灉","妫�鏌�"); + return AjaxResult.success("鍚屾鎴愬姛"); + + } catch (Exception e) { + log.error(String.valueOf(e)); + } return AjaxResult.success(); } -- Gitblit v1.8.0