From 02ced282179511ba05d50baf63ac74b53ec71f93 Mon Sep 17 00:00:00 2001
From: 赵文轩 <1652863494@qq.com>
Date: 星期四, 13 六月 2024 15:50:02 +0800
Subject: [PATCH] 撤销调用his作废

---
 ltkj-admin/src/main/java/com/ltkj/web/controller/his/HisApiMethod.java |  167 +++++++++++++++++++++++++++++--------------------------
 1 files changed, 88 insertions(+), 79 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..6492eac 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) {
@@ -60,8 +63,7 @@
 
     //瀵规帴his鎬绘帴鍙�  娉ㄥ唽鎸傚彿鎺ヨ瘖鐢宠鍗曟搷浣�
     @Transactional
-    public void HisApiMethods(TjCustomer customer, Long orderId) {
-//        HisApiGetMethodService hisApiGetMethodService = new HisApiGetMethodService();
+    public AjaxResult HisApiMethods(TjCustomer customer, Long orderId) {
 
         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,8 +161,10 @@
                         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,JSONUtil.toJsonStr(BeanUtil.beanToMap(dto)));
 
+                    }else {
+                        return AjaxResult.success();
                     }
                     //闂ㄨ瘖妫�鏌ョ敵璇�
                     OutpinexamapplyDto outpinexamapplyDto = new OutpinexamapplyDto();
@@ -177,28 +180,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,8 +220,10 @@
                         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,JSONUtil.toJsonStr(BeanUtil.beanToMap(outpinexamapplyDto)));
 
+                    }else {
+                        return AjaxResult.success();
                     }
 
                     //闂ㄨ瘖娌荤枟澶勭疆鐢宠
@@ -235,24 +245,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);
@@ -264,23 +278,18 @@
                         map.put("cardId", customer.getCardId());
                         JSONObject jsonObject = JSONUtil.parseObj(map);
                         LambdaQueryWrapper<HisApiConfig> lambdaQueryWrapper = new LambdaQueryWrapper<>();
-                        lambdaQueryWrapper.eq(HisApiConfig::getApiMethod, "Outpinmedapply");
+                        lambdaQueryWrapper.eq(HisApiConfig::getApiMethod, "Outpintreatapply");
                         HisApiConfig hisApiConfig = hisApiConfigService.getOne(lambdaQueryWrapper);
-                        hisApiGetMethodService.save(jsonObject, "Outpinmedapply",hisApiConfig);
-
+                        hisApiGetMethodService.save(jsonObject, "Outpintreatapply", hisApiConfig,JSONUtil.toJsonStr(BeanUtil.beanToMap(dao)));
+                    }else {
+                        return AjaxResult.error();
                     }
-
-//                                    }
+                    return AjaxResult.success();
                 }
             }
         }
-//                    }
-
+        return AjaxResult.error();
     }
-//            }
-//}
-//        }
-//    }
 
 
     //閫�璐瑰悗鍙栨秷鎺ヨ瘖浣滃簾鐢宠鍗曠瓑鎿嶄綔

--
Gitblit v1.8.0