From 5a6a1ae4f22cae6323e41d35c5f32137afddd2d0 Mon Sep 17 00:00:00 2001 From: zjh <zjh@888> Date: 星期三, 12 六月 2024 16:59:08 +0800 Subject: [PATCH] zjh 本地 2024/06/12 --1 --- ltkj-admin/src/main/java/com/ltkj/web/controller/his/HisApiMethod.java | 153 ++++++++++++++++++++++++++------------------------- 1 files changed, 78 insertions(+), 75 deletions(-) diff --git a/ltkj-admin/src/main/java/com/ltkj/web/controller/his/HisApiMethod.java b/ltkj-admin/src/main/java/com/ltkj/web/controller/his/HisApiMethod.java index 61546c2..85157ab 100644 --- a/ltkj-admin/src/main/java/com/ltkj/web/controller/his/HisApiMethod.java +++ b/ltkj-admin/src/main/java/com/ltkj/web/controller/his/HisApiMethod.java @@ -12,6 +12,7 @@ import com.ltkj.hosp.domain.*; import com.ltkj.hosp.hisDto.*; import com.ltkj.hosp.service.*; +import com.ltkj.system.service.ISysConfigService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; import org.springframework.transaction.annotation.Transactional; @@ -46,6 +47,8 @@ private HisApiConfigService hisApiConfigService; @Autowired private HisApiGetMethodService hisApiGetMethodService; + @Resource + private ISysConfigService configService; //灏嗘柟娉曡繑鍥炲�艰В鏋愭垚json鏍煎紡 public JSONObject getJSONObject(String builder) { @@ -61,7 +64,6 @@ //瀵规帴his鎬绘帴鍙� 娉ㄥ唽鎸傚彿鎺ヨ瘖鐢宠鍗曟搷浣� @Transactional public void HisApiMethods(TjCustomer customer, Long orderId) { -// HisApiGetMethodService hisApiGetMethodService = new HisApiGetMethodService(); Date dates = new Date(); final String date = DateUtil.format(dates, "yyyy-MM-dd HH:mm:ss"); @@ -77,37 +79,33 @@ if (null != pationid) { customer.setPationId(pationid); customerService.updateById(customer); - // OutpinregapplyDto outpinregapplyDto = new OutpinregapplyDto(); -// outpinregapplyDto.setPationid(pationid); -//// outpinregapplyDto.setHisRegistrationId(pationid); -// outpinregapplyDto.setSqysbm(SecurityUtils.getUsername()); -// outpinregapplyDto.setMzksbm("0101"); -// outpinregapplyDto.setCzybm("00029"); -// outpinregapplyDto.setSfjz("0"); -// outpinregapplyDto.setGhzlbm("01"); -// outpinregapplyDto.setYwckbm("0001"); -// outpinregapplyDto.setSflstd("0"); -// outpinregapplyDto.setGhrq(date); -// //闂ㄨ瘖鎸傚彿 -// AjaxResult ajaxResult = controller.Outpinregapply(outpinregapplyDto); -// String result2 = getAjaxResult(ajaxResult); -// JSONObject object1 = getJSONObject(result2); -// String code1 = object1.getStr("ResultCode"); -// if (code1.equals("0")) { -// JSONArray resultDatas = object1.getJSONArray("ResultData"); -// if (null != resultDatas && resultDatas.size() > 0) { -// Map<String, Object> resultDatasss = (Map<String, Object>) resultDatas.get(0); -// String hisRegistrationId = resultDatasss.get("his_registration_id").toString(); -// if (null != hisRegistrationId) { -// //闂ㄨ瘖鍖荤敓鎺ヨ瘖 -// AjaxResult result3 = controller.Outpinconapply(hisRegistrationId, date, SecurityUtils.getUsername()); -// String result4 = getAjaxResult(result3); -// JSONObject object2 = getJSONObject(result4); -// String code2 = object2.getStr("ResultCode"); -// if (code2.equals("0")) { -// Map<String, Object> data = object2.getJSONObject("ResultData"); -// String toString = data.get("his_registration_id").toString(); -// if (null != toString) { + /* String key = configService.selectConfigByKey("getInfoFromSqlData"); + if (null != key && key.equals("Y")) { + OutpinregapplyDto outpinregapplyDto = new OutpinregapplyDto(); + outpinregapplyDto.setPationid(pationid); + outpinregapplyDto.setSqysbm(SecurityUtils.getUsername()); + outpinregapplyDto.setMzksbm("0101"); + outpinregapplyDto.setCzybm("00029"); + outpinregapplyDto.setSfjz("0"); + outpinregapplyDto.setGhzlbm("01"); + outpinregapplyDto.setYwckbm("0001"); + outpinregapplyDto.setSflstd("0"); + outpinregapplyDto.setGhrq(date); + //闂ㄨ瘖鎸傚彿 + AjaxResult ajaxResult = controller.Outpinregapply(outpinregapplyDto); + String result2 = getAjaxResult(ajaxResult); + JSONObject object1 = getJSONObject(result2); + String code1 = object1.getStr("ResultCode"); + if (code1.equals("0")) { + JSONArray resultDatas = object1.getJSONArray("ResultData"); + if (null != resultDatas && resultDatas.size() > 0) { + //闂ㄨ瘖鍖荤敓鎺ヨ瘖 + controller.Outpinconapply(customer.getCardId(), date, SecurityUtils.getUsername()); + } + } + } +*/ + //妫�楠岀敵璇� OutpintestapplyDto dto = new OutpintestapplyDto(); dto.setHisRegistrationId(customer.getCardId()); @@ -124,29 +122,32 @@ LambdaQueryWrapper<TjProject> wq = new LambdaQueryWrapper<>(); wq.in(TjProject::getProId, detailList.stream().map(TbTransition::getParentProId).collect(Collectors.toList())); wq.groupBy(TjProject::getHisXmbm); - wq.in(TjProject::getDeptId, "241"); + wq.in(TjProject::getDeptId, "241","317"); List<TjProject> projects = projectService.list(wq); if (null != projects && projects.size() > 0) { for (TjProject project : projects) { - OutpintestapplyDetailsDto detailsDto = new OutpintestapplyDetailsDto(); if (0 == project.getProParentId() && project.getProPrice().compareTo(BigDecimal.ZERO) != 0) { if (null != project.getHisXmbm()) { + OutpintestapplyDetailsDto detailsDto = new OutpintestapplyDetailsDto(); detailsDto.setMxfyxmbm(project.getHisXmbm()); -// if(project.getHisXmbm().toLowerCase().contains("z".toLowerCase())){ - detailsDto.setSfzhfy("1"); -// }else { -// detailsDto.setSfzhfy("0"); -// } - } else { - detailsDto.setMxfyxmbm(""); - detailsDto.setSfzhfy("0"); + if(project.getSfzhfy().equals("Y")){ + detailsDto.setSfzhfy("1"); + }else { + detailsDto.setSfzhfy("0"); + } + detailsDto.setSl(1); + detailsDtos.add(detailsDto); } - detailsDto.setSfzhfy("1"); - detailsDto.setSl(1); - detailsDtos.add(detailsDto); } } } + } + if (detailsDtos.size()==0) { + OutpintestapplyDetailsDto detailsDto = new OutpintestapplyDetailsDto(); + detailsDto.setMxfyxmbm(""); + detailsDto.setSfzhfy(""); + detailsDto.setSl(0); + detailsDtos.add(detailsDto); } dto.setDetails(detailsDtos); AjaxResult ajaxResult1 = controller.Outpintestapply(dto); @@ -160,7 +161,7 @@ LambdaQueryWrapper<HisApiConfig> lambdaQueryWrapper = new LambdaQueryWrapper<>(); lambdaQueryWrapper.eq(HisApiConfig::getApiMethod, "Outpintestapply"); HisApiConfig hisApiConfig = hisApiConfigService.getOne(lambdaQueryWrapper); - hisApiGetMethodService.save(object4, "Outpintestapply",hisApiConfig); + hisApiGetMethodService.save(object4, "Outpintestapply", hisApiConfig); } //闂ㄨ瘖妫�鏌ョ敵璇� @@ -177,28 +178,33 @@ LambdaQueryWrapper<TjProject> wq = new LambdaQueryWrapper<>(); wq.in(TjProject::getProId, detailLists.stream().map(TbTransition::getParentProId).collect(Collectors.toList())); wq.groupBy(TjProject::getHisXmbm); - wq.in(TjProject::getDeptId, "247", "248", "249", "250", "251", "252", "271", "273", "274", "275"); + wq.in(TjProject::getDeptId, "247", "248", "249", "250", "251", "252", "271", "273", "274", "275","298"); List<TjProject> projects = projectService.list(wq); if (null != projects && projects.size() > 0) { for (TjProject project : projects) { - OutpintestapplyDetailsDto detailsDto = new OutpintestapplyDetailsDto(); if (0 == project.getProParentId() && project.getProPrice().compareTo(BigDecimal.ZERO) != 0) { if (null != project.getHisXmbm()) { + OutpintestapplyDetailsDto detailsDto = new OutpintestapplyDetailsDto(); detailsDto.setMxfyxmbm(project.getHisXmbm()); -// if(project.getHisXmbm().toLowerCase().contains("z".toLowerCase())){ - detailsDto.setSfzhfy("1"); -// }else { -// detailsDto.setSfzhfy("0"); -// } - } else { - detailsDto.setMxfyxmbm(""); - detailsDto.setSfzhfy("0"); + if(project.getSfzhfy().equals("Y")){ + detailsDto.setSfzhfy("1"); + }else { + detailsDto.setSfzhfy("0"); + } + detailsDto.setSl(1); + detailsDtoss.add(detailsDto); } - detailsDto.setSl(1); - detailsDtoss.add(detailsDto); + } } } + } + if (detailsDtoss.size()==0) { + OutpintestapplyDetailsDto detailsDto = new OutpintestapplyDetailsDto(); + detailsDto.setMxfyxmbm(""); + detailsDto.setSfzhfy(""); + detailsDto.setSl(0); + detailsDtoss.add(detailsDto); } outpinexamapplyDto.setDetails(detailsDtoss); AjaxResult ajaxResult2 = controller.Outpinexamapply(outpinexamapplyDto); @@ -212,7 +218,7 @@ LambdaQueryWrapper<HisApiConfig> lambdaQueryWrapper = new LambdaQueryWrapper<>(); lambdaQueryWrapper.eq(HisApiConfig::getApiMethod, "Outpinexamapply"); HisApiConfig hisApiConfig = hisApiConfigService.getOne(lambdaQueryWrapper); - hisApiGetMethodService.save(jsonObject, "Outpinexamapply",hisApiConfig); + hisApiGetMethodService.save(jsonObject, "Outpinexamapply", hisApiConfig); } @@ -235,24 +241,28 @@ List<TjProject> projects = projectService.list(wq); if (null != projects && projects.size() > 0) { for (TjProject project : projects) { - OutpintestapplyDetailsDto detailsDto = new OutpintestapplyDetailsDto(); if (0 == project.getProParentId() && project.getProPrice().compareTo(BigDecimal.ZERO) != 0) { if (null != project.getHisXmbm()) { + OutpintestapplyDetailsDto detailsDto = new OutpintestapplyDetailsDto(); detailsDto.setMxfyxmbm(project.getHisXmbm()); - if(project.getHisXmbm().toLowerCase().contains("z".toLowerCase())){ + if (project.getSfzhfy().equals("Y")) { detailsDto.setSfzhfy("1"); - }else { + } else { detailsDto.setSfzhfy("0"); } - } else { - detailsDto.setMxfyxmbm(""); - detailsDto.setSfzhfy("0"); + detailsDto.setSl(1); + detailDtos.add(detailsDto); } - detailsDto.setSl(1); - detailDtos.add(detailsDto); } } } + } + if (detailDtos.size()==0) { + OutpintestapplyDetailsDto detailsDto = new OutpintestapplyDetailsDto(); + detailsDto.setMxfyxmbm(""); + detailsDto.setSfzhfy(""); + detailsDto.setSl(0); + detailDtos.add(detailsDto); } dao.setDetails(detailDtos); AjaxResult mzylyzsq1 = controller.Outpintreatapply(dao); @@ -266,21 +276,14 @@ LambdaQueryWrapper<HisApiConfig> lambdaQueryWrapper = new LambdaQueryWrapper<>(); lambdaQueryWrapper.eq(HisApiConfig::getApiMethod, "Outpinmedapply"); HisApiConfig hisApiConfig = hisApiConfigService.getOne(lambdaQueryWrapper); - hisApiGetMethodService.save(jsonObject, "Outpinmedapply",hisApiConfig); + hisApiGetMethodService.save(jsonObject, "Outpinmedapply", hisApiConfig); } - -// } } } } -// } } -// } -//} -// } -// } //閫�璐瑰悗鍙栨秷鎺ヨ瘖浣滃簾鐢宠鍗曠瓑鎿嶄綔 -- Gitblit v1.8.0