From c0f0bf3c1c598c10d4eb80751960bca76da50b0d Mon Sep 17 00:00:00 2001
From: zjh <zjh@888>
Date: 星期五, 14 六月 2024 18:03:32 +0800
Subject: [PATCH] zjh 本地 2024/06/14 --1

---
 ltkj-admin/src/main/java/com/ltkj/web/controller/his/HisApiMethod.java |  145 +++++++++++++++++------------------------------
 1 files changed, 53 insertions(+), 92 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 0524d57..bb19a92 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
@@ -79,32 +79,6 @@
                 if (null != pationid) {
                     customer.setPationId(pationid);
                     customerService.updateById(customer);
-                    /*                  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();
@@ -142,30 +116,26 @@
                             }
                         }
                     }
-                    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);
-                    String result5 = getAjaxResult(ajaxResult1);
-                    JSONObject object3 = getJSONObject(result5);
-                    String code3 = object3.getStr("ResultCode");
-                    if (code3.equals("0")) {
-                        Map<String, Object> datas = object3.getJSONObject("ResultData");
-                        datas.put("cardId", customer.getCardId());
-                        JSONObject object4 = JSONUtil.parseObj(datas);
-                        LambdaQueryWrapper<HisApiConfig> lambdaQueryWrapper = new LambdaQueryWrapper<>();
-                        lambdaQueryWrapper.eq(HisApiConfig::getApiMethod, "Outpintestapply");
-                        HisApiConfig hisApiConfig = hisApiConfigService.getOne(lambdaQueryWrapper);
-                        hisApiGetMethodService.save(object4, "Outpintestapply", hisApiConfig,JSONUtil.toJsonStr(BeanUtil.beanToMap(dto)));
+                    if (detailsDtos.size()>0) {
+                        dto.setDetails(detailsDtos);
+                        AjaxResult ajaxResult1 = controller.Outpintestapply(dto);
+                        String result5 = getAjaxResult(ajaxResult1);
+                        JSONObject object3 = getJSONObject(result5);
+                        String code3 = object3.getStr("ResultCode");
+                        if (code3.equals("0")) {
+                            Map<String, Object> datas = object3.getJSONObject("ResultData");
+                            datas.put("cardId", customer.getCardId());
+                            JSONObject object4 = JSONUtil.parseObj(datas);
+                            LambdaQueryWrapper<HisApiConfig> lambdaQueryWrapper = new LambdaQueryWrapper<>();
+                            lambdaQueryWrapper.eq(HisApiConfig::getApiMethod, "Outpintestapply");
+                            HisApiConfig hisApiConfig = hisApiConfigService.getOne(lambdaQueryWrapper);
+                            hisApiGetMethodService.save(object4, "Outpintestapply", hisApiConfig,JSONUtil.toJsonStr(BeanUtil.beanToMap(dto)));
 
-                    }else {
-                        return AjaxResult.success();
+                        }else {
+                            return AjaxResult.error();
+                        }
                     }
+
                     //闂ㄨ瘖妫�鏌ョ敵璇�
                     OutpinexamapplyDto outpinexamapplyDto = new OutpinexamapplyDto();
                     outpinexamapplyDto.setHisRegistrationId(customer.getCardId());
@@ -201,30 +171,26 @@
                             }
                         }
                     }
-                    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);
-                    String result6 = getAjaxResult(ajaxResult2);
-                    JSONObject object5 = getJSONObject(result6);
-                    String code4 = object5.getStr("ResultCode");
-                    if (code4.equals("0")) {
-                        Map<String, Object> map = object5.getJSONObject("ResultData");
-                        map.put("cardId", customer.getCardId());
-                        JSONObject jsonObject = JSONUtil.parseObj(map);
-                        LambdaQueryWrapper<HisApiConfig> lambdaQueryWrapper = new LambdaQueryWrapper<>();
-                        lambdaQueryWrapper.eq(HisApiConfig::getApiMethod, "Outpinexamapply");
-                        HisApiConfig hisApiConfig = hisApiConfigService.getOne(lambdaQueryWrapper);
-                        hisApiGetMethodService.save(jsonObject, "Outpinexamapply", hisApiConfig,JSONUtil.toJsonStr(BeanUtil.beanToMap(outpinexamapplyDto)));
+                    if (detailsDtoss.size()>0) {
+                        outpinexamapplyDto.setDetails(detailsDtoss);
+                        AjaxResult ajaxResult2 = controller.Outpinexamapply(outpinexamapplyDto);
+                        String result6 = getAjaxResult(ajaxResult2);
+                        JSONObject object5 = getJSONObject(result6);
+                        String code4 = object5.getStr("ResultCode");
+                        if (code4.equals("0")) {
+                            Map<String, Object> map = object5.getJSONObject("ResultData");
+                            map.put("cardId", customer.getCardId());
+                            JSONObject jsonObject = JSONUtil.parseObj(map);
+                            LambdaQueryWrapper<HisApiConfig> lambdaQueryWrapper = new LambdaQueryWrapper<>();
+                            lambdaQueryWrapper.eq(HisApiConfig::getApiMethod, "Outpinexamapply");
+                            HisApiConfig hisApiConfig = hisApiConfigService.getOne(lambdaQueryWrapper);
+                            hisApiGetMethodService.save(jsonObject, "Outpinexamapply", hisApiConfig,JSONUtil.toJsonStr(BeanUtil.beanToMap(outpinexamapplyDto)));
 
-                    }else {
-                        return AjaxResult.success();
+                        }else {
+                            return AjaxResult.error();
+                        }
                     }
+
 
                     //闂ㄨ瘖娌荤枟澶勭疆鐢宠
                     OutpintreatapplyDto dao = new OutpintreatapplyDto();
@@ -261,28 +227,23 @@
                             }
                         }
                     }
-                    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);
-                    String mzylyzsq2 = getAjaxResult(mzylyzsq1);
-                    JSONObject mzylyzsq3 = getJSONObject(mzylyzsq2);
-                    String code5 = mzylyzsq3.getStr("ResultCode");
-                    if (code5.equals("0")) {
-                        Map<String, Object> map = mzylyzsq3.getJSONObject("ResultData");
-                        map.put("cardId", customer.getCardId());
-                        JSONObject jsonObject = JSONUtil.parseObj(map);
-                        LambdaQueryWrapper<HisApiConfig> lambdaQueryWrapper = new LambdaQueryWrapper<>();
-                        lambdaQueryWrapper.eq(HisApiConfig::getApiMethod, "Outpintreatapply");
-                        HisApiConfig hisApiConfig = hisApiConfigService.getOne(lambdaQueryWrapper);
-                        hisApiGetMethodService.save(jsonObject, "Outpintreatapply", hisApiConfig,JSONUtil.toJsonStr(BeanUtil.beanToMap(dao)));
-                    }else {
-                        return AjaxResult.error();
+                    if (detailDtos.size()>0) {
+                        dao.setDetails(detailDtos);
+                        AjaxResult mzylyzsq1 = controller.Outpintreatapply(dao);
+                        String mzylyzsq2 = getAjaxResult(mzylyzsq1);
+                        JSONObject mzylyzsq3 = getJSONObject(mzylyzsq2);
+                        String code5 = mzylyzsq3.getStr("ResultCode");
+                        if (code5.equals("0")) {
+                            Map<String, Object> map = mzylyzsq3.getJSONObject("ResultData");
+                            map.put("cardId", customer.getCardId());
+                            JSONObject jsonObject = JSONUtil.parseObj(map);
+                            LambdaQueryWrapper<HisApiConfig> lambdaQueryWrapper = new LambdaQueryWrapper<>();
+                            lambdaQueryWrapper.eq(HisApiConfig::getApiMethod, "Outpintreatapply");
+                            HisApiConfig hisApiConfig = hisApiConfigService.getOne(lambdaQueryWrapper);
+                            hisApiGetMethodService.save(jsonObject, "Outpintreatapply", hisApiConfig,JSONUtil.toJsonStr(BeanUtil.beanToMap(dao)));
+                        }else {
+                            return AjaxResult.error();
+                        }
                     }
                     return AjaxResult.success();
                 }

--
Gitblit v1.8.0