From 45b5e3f63283e622f4321f3d03992343636dabf8 Mon Sep 17 00:00:00 2001 From: zjh <1084500556@qq.com> Date: 星期五, 07 二月 2025 16:18:22 +0800 Subject: [PATCH] zjh20250207 --- ltkj-hosp/src/main/resources/mapper/hosp/DictHospMapper.xml | 7 ++----- ltkj-hosp/src/main/java/com/ltkj/hosp/domain/DictHosp.java | 3 +-- ltkj-framework/src/main/java/com/ltkj/framework/interceptor/DBChangeInterceptor.java | 11 ++++++----- ltkj-framework/src/main/java/com/ltkj/framework/config/WebConfig.java | 2 +- 4 files changed, 10 insertions(+), 13 deletions(-) diff --git a/ltkj-framework/src/main/java/com/ltkj/framework/config/WebConfig.java b/ltkj-framework/src/main/java/com/ltkj/framework/config/WebConfig.java index 1d73d60..d8ca377 100644 --- a/ltkj-framework/src/main/java/com/ltkj/framework/config/WebConfig.java +++ b/ltkj-framework/src/main/java/com/ltkj/framework/config/WebConfig.java @@ -38,7 +38,7 @@ .excludePathPatterns(new String[]{ "/system/dict/data/**", "/system/dict/type/**", - "/captchaImage" + "/captchaImage","/getCaptchaConfigKey/**" // , // "/login", "/register", "/captchaImage","/cus/**","/getCaptchaConfigKey","/report/jmreport/**", // "/sqlserver/getdata/**","/api/His/**","/system/config/zx","/system/config/gxxmpym","/system/report/savePdf", diff --git a/ltkj-framework/src/main/java/com/ltkj/framework/interceptor/DBChangeInterceptor.java b/ltkj-framework/src/main/java/com/ltkj/framework/interceptor/DBChangeInterceptor.java index fc7c7f0..ee96596 100644 --- a/ltkj-framework/src/main/java/com/ltkj/framework/interceptor/DBChangeInterceptor.java +++ b/ltkj-framework/src/main/java/com/ltkj/framework/interceptor/DBChangeInterceptor.java @@ -40,23 +40,24 @@ response.getWriter().write("{\"message\":\"401锛氭壘涓嶅埌闄㈠尯缂栧彿\"}"); return false; } - DictHosp hosp = null; +// DictHosp hosp = null; try { DataSourceContextHolder.setDataSourceKey("default"); LambdaQueryWrapper<DictHosp> wrapper = new LambdaQueryWrapper<>(); wrapper.eq(DictHosp::getCode,hospId); - hosp = dictHospService.getOne(wrapper); - if (hosp == null || hosp.getDatabase() == null || hosp.getDatabase().trim().isEmpty()) { + DictHosp hosp = dictHospService.getOne(wrapper); + if (hosp == null || hosp.getDbname() == null || hosp.getDbname().trim().isEmpty()) { response.setStatus(HttpServletResponse.SC_UNAUTHORIZED); response.setContentType("application/json;charset=UTF-8"); response.getWriter().write("{\"message\":\"401锛氭壘涓嶅埌闄㈠尯鏁版嵁\"}"); return false; } - dataSourceConfig.addDataSource(hosp.getDatabase()); + dataSourceConfig.addDataSource(hosp.getDbname()); + DataSourceContextHolder.setDataSourceKey(hosp.getDbname()); } catch (IOException e) { return false; } - DataSourceContextHolder.setDataSourceKey(hosp.getDatabase()); + return true; } diff --git a/ltkj-hosp/src/main/java/com/ltkj/hosp/domain/DictHosp.java b/ltkj-hosp/src/main/java/com/ltkj/hosp/domain/DictHosp.java index cda83e6..91ffaac 100644 --- a/ltkj-hosp/src/main/java/com/ltkj/hosp/domain/DictHosp.java +++ b/ltkj-hosp/src/main/java/com/ltkj/hosp/domain/DictHosp.java @@ -174,7 +174,7 @@ private Date expirationTime; // 鏁版嵁搴撳悕 - private String database; + private String dbname; @Override @@ -206,7 +206,6 @@ .append("updateByName", getUpdateByName()) .append("imgbase64", getImgbase64()) .append("deleted", getDeleted()) - .append("database", getDatabase()) .toString(); } } diff --git a/ltkj-hosp/src/main/resources/mapper/hosp/DictHospMapper.xml b/ltkj-hosp/src/main/resources/mapper/hosp/DictHospMapper.xml index ebf675b..d8bb389 100644 --- a/ltkj-hosp/src/main/resources/mapper/hosp/DictHospMapper.xml +++ b/ltkj-hosp/src/main/resources/mapper/hosp/DictHospMapper.xml @@ -31,7 +31,7 @@ <result property="updateByName" column="update_by_name"/> <result property="imgbase64" column="imgBase64"/> <result property="deleted" column="deleted"/> - <result property="database" column="database"/> +<!-- <result property="dbname" column="dbname"/>--> </resultMap> <sql id="selectDictHospVo"> @@ -60,7 +60,7 @@ create_by_name, update_by_name, imgBase64, - deleted,database + deleted from dict_hosp </sql> @@ -117,7 +117,6 @@ <if test="updateByName != null and updateByName != ''">update_by_name,</if> <if test="imgbase64 != null">imgBase64,</if> <if test="deleted != null">deleted,</if> - <if test="database != null">database,</if> </trim> <trim prefix="values (" suffix=")" suffixOverrides=","> <if test="hospAreaId != null">#{hospAreaId},</if> @@ -146,7 +145,6 @@ <if test="updateByName != null and updateByName != ''">#{updateByName},</if> <if test="imgbase64 != null">#{imgbase64},</if> <if test="deleted != null">#{deleted},</if> - <if test="database != null">#{database},</if> </trim> </insert> @@ -178,7 +176,6 @@ <if test="updateByName != null and updateByName != ''">update_by_name = #{updateByName},</if> <if test="imgbase64 != null">imgBase64 = #{imgbase64},</if> <if test="deleted != null">deleted = #{deleted},</if> - <if test="database != null">database = #{database},</if> </trim> where hosp_area_id = #{hospAreaId} </update> -- Gitblit v1.8.0