From 983d95bdcbb273b4a78efd0058a2a35141be1b51 Mon Sep 17 00:00:00 2001
From: zjh <1084500556@qq.com>
Date: 星期二, 08 四月 2025 18:00:12 +0800
Subject: [PATCH] zjh20250408

---
 ltkj-admin/src/main/java/com/ltkj/web/controller/system/TjCustomerController.java |   25 ++++++++++++++++++++++---
 1 files changed, 22 insertions(+), 3 deletions(-)

diff --git a/ltkj-admin/src/main/java/com/ltkj/web/controller/system/TjCustomerController.java b/ltkj-admin/src/main/java/com/ltkj/web/controller/system/TjCustomerController.java
index 0f5846d..242247d 100644
--- a/ltkj-admin/src/main/java/com/ltkj/web/controller/system/TjCustomerController.java
+++ b/ltkj-admin/src/main/java/com/ltkj/web/controller/system/TjCustomerController.java
@@ -16,6 +16,7 @@
 import com.ltkj.common.enums.BusinessType;
 import com.ltkj.common.enums.DataSourceType;
 import com.ltkj.common.utils.SecurityUtils;
+import com.ltkj.db.DataSourceContextHolder;
 import com.ltkj.framework.config.MatchUtils;
 import com.ltkj.framework.datasource.DynamicDataSourceContextHolder;
 import com.ltkj.hosp.domain.HisApiConfig;
@@ -241,7 +242,11 @@
                     tjCustomer1.setTjType(tjReservation.getTjType());
                     tjCustomer1.setCusName(tjReservation.getName());
                     tjCustomer1.setCusSex(Long.valueOf(tjReservation.getSex()));
-                    tjCustomer1.setCusBrithday(DateUtil.parse(MatchUtils.getBirthDayByIdCard(tjReservation.getIdCard()), "yyyy-MM-dd"));
+                    try {
+                        tjCustomer1.setCusBrithday(DateUtil.parse(MatchUtils.getBirthDayByIdCard(tjReservation.getIdCard()), "yyyy-MM-dd"));
+                    } catch (Exception e) {
+                        return AjaxResult.error("韬唤璇佸彿涓嶆纭�");
+                    }
                     tjCustomer1.setCusPhone(tjReservation.getPhoe());
                     tjCustomer1.setCusEmail(tjReservation.getEmail());
                     tjCustomer1.setCusAddr(tjReservation.getAddress());
@@ -271,7 +276,11 @@
                     tjCustomer.setCusIdcard(tjReservation.getIdCard());
                     tjCustomer.setCusName(tjReservation.getName());
                     tjCustomer.setCusSex(Long.valueOf(tjReservation.getSex()));
-                    tjCustomer.setCusBrithday(DateUtil.parse(MatchUtils.getBirthDayByIdCard(tjReservation.getIdCard()), "yyyy-MM-dd"));
+                    try {
+                        tjCustomer.setCusBrithday(DateUtil.parse(MatchUtils.getBirthDayByIdCard(tjReservation.getIdCard()), "yyyy-MM-dd"));
+                    } catch (Exception e) {
+                        return AjaxResult.error("韬唤璇佸彿涓嶆纭�");
+                    }
                     tjCustomer.setCusPhone(tjReservation.getPhoe());
                     tjCustomer.setCusEmail(tjReservation.getEmail());
                     tjCustomer.setCusAddr(tjReservation.getAddress());
@@ -510,15 +519,25 @@
         String substring = cusIdcard.substring(cusIdcard.length() - 6);
         substring = DigestUtils.md5DigestAsHex(substring.getBytes());
         tjCustomer.setCusPassword(substring);
-        if(cusIdcard.length()==18)tjCustomer.setCusBrithday(DateUtil.parse(MatchUtils.getBirthDayByIdCard(tjCustomer.getCusIdcard()), "yyyy-MM-dd"));
+        if(cusIdcard.length()==18) {
+            try {
+                tjCustomer.setCusBrithday(DateUtil.parse(MatchUtils.getBirthDayByIdCard(tjCustomer.getCusIdcard()), "yyyy-MM-dd"));
+            } catch (Exception e) {
+                return AjaxResult.error("韬唤璇佸彿涓嶆纭�");
+            }
+        }
         tjCustomer.setCusNumber(0L);
         tjCustomer.setPym(PinyinUtil.getFirstLetter(tjCustomer.getCusName(),""));
         String config = sysConfigService.selectConfigByKey("sfkqdyhis");
+        logger.info("config ->{}",config);
+        String dataSourceType = DataSourceContextHolder.getDataSourceKey();
+        logger.info("鐧昏褰撳墠鏁版嵁婧� ->{}",dataSourceType);
         if (null != config && config.equals("Y")) {
             AjaxResult tjCustomer1 = suijieHisXinXi(tjCustomer, date);
             if (tjCustomer1 != null) return tjCustomer1;
         } else {
             String s = sysConfigService.selectConfigByKey("is_request_common_his_api");
+            logger.info("s ->{}",s);
             if (null != s && s.equals("Y")){
                 TjCustomer requestCommonHisApi = isRequestCommonHisApi(tjCustomer);
                 if (null !=requestCommonHisApi){

--
Gitblit v1.8.0