|
@@ -27,14 +27,18 @@ public class CacheFileManager {
|
|
private String password;
|
|
private String password;
|
|
private String url;
|
|
private String url;
|
|
|
|
|
|
- private String hospitalId = "1";
|
|
|
|
|
|
+ private static String hospitalId = "3";
|
|
|
|
|
|
private String path = "";
|
|
private String path = "";
|
|
|
|
|
|
public static void main(String[] args) {
|
|
public static void main(String[] args) {
|
|
CacheFileManager cacheFileManager = new CacheFileManager();
|
|
CacheFileManager cacheFileManager = new CacheFileManager();
|
|
String p = cacheFileManager.getClass().getResource("/").getPath();
|
|
String p = cacheFileManager.getClass().getResource("/").getPath();
|
|
- p = p.substring(0, p.indexOf("/target/")) + "/src/main/resources/cache/";
|
|
|
|
|
|
+ p = p.substring(0, p.indexOf("/target/")) + "/src/main/resources/cache/"+ hospitalId + "/";
|
|
|
|
+ File file = new File(p);
|
|
|
|
+ if (!file.exists()) {
|
|
|
|
+ file.mkdir();
|
|
|
|
+ }
|
|
cacheFileManager.createCacheFile(p);
|
|
cacheFileManager.createCacheFile(p);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -45,9 +49,9 @@ public class CacheFileManager {
|
|
// user = encrypDES.decryptor(propertiesUtil.getProperty("mysql.redis.user"));
|
|
// user = encrypDES.decryptor(propertiesUtil.getProperty("mysql.redis.user"));
|
|
// password = encrypDES.decryptor(propertiesUtil.getProperty("mysql.redis.password"));
|
|
// password = encrypDES.decryptor(propertiesUtil.getProperty("mysql.redis.password"));
|
|
// url = encrypDES.decryptor(propertiesUtil.getProperty("mysql.redis.url"));
|
|
// url = encrypDES.decryptor(propertiesUtil.getProperty("mysql.redis.url"));
|
|
- user = propertiesUtil.getProperty("mysql.test.user");
|
|
|
|
- password = propertiesUtil.getProperty("mysql.test.password");
|
|
|
|
- url = propertiesUtil.getProperty("mysql.test.url");
|
|
|
|
|
|
+ user = propertiesUtil.getProperty("mysql.redis.user");
|
|
|
|
+ password = propertiesUtil.getProperty("mysql.redis.password");
|
|
|
|
+ url = propertiesUtil.getProperty("mysql.redis.url");
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
logger.info("数据库连接信息出错...." + e.getMessage());
|
|
logger.info("数据库连接信息出错...." + e.getMessage());
|
|
}
|
|
}
|
|
@@ -74,7 +78,7 @@ public class CacheFileManager {
|
|
}
|
|
}
|
|
|
|
|
|
//所有词典库 不能用concat_group 大小写不区分
|
|
//所有词典库 不能用concat_group 大小写不区分
|
|
- sql = "select dis.name, dis.is_chronic, dis.is_infections, dis.name group_name from kl_disease dis order by name";
|
|
|
|
|
|
+ sql = "select dis.name, dis.is_chronic, dis.is_infections, dis.name group_name from kl_disease dis where hospital_id = " + hospitalId + " order by name";
|
|
|
|
|
|
FileWriter fw = new FileWriter(path + "concept_diag_properties.dict");
|
|
FileWriter fw = new FileWriter(path + "concept_diag_properties.dict");
|
|
rs = st.executeQuery(sql);
|
|
rs = st.executeQuery(sql);
|
|
@@ -113,7 +117,7 @@ public class CacheFileManager {
|
|
fw.close();
|
|
fw.close();
|
|
|
|
|
|
//医院疾病信息
|
|
//医院疾病信息
|
|
- sql = "select name from kl_disease";
|
|
|
|
|
|
+ sql = "select name from kl_disease where hospital_id = " + hospitalId;
|
|
|
|
|
|
fw = new FileWriter(path + "hospital_diag_info.dict");
|
|
fw = new FileWriter(path + "hospital_diag_info.dict");
|
|
rs = st.executeQuery(sql);
|
|
rs = st.executeQuery(sql);
|
|
@@ -128,14 +132,15 @@ public class CacheFileManager {
|
|
fw.close();
|
|
fw.close();
|
|
|
|
|
|
//医院医生信息
|
|
//医院医生信息
|
|
- sql = "select doctor_id, doctor_name, dept_id, dept_name, professor from qc_doctor_info where hospital_id = " + hospitalId;
|
|
|
|
|
|
+ sql = "select doctor_id, name, dept_id, professor, occup from bas_doctor_info where hospital_id = " + hospitalId;
|
|
|
|
|
|
fw = new FileWriter(path + "hospital_doctor_info.dict");
|
|
fw = new FileWriter(path + "hospital_doctor_info.dict");
|
|
rs = st.executeQuery(sql);
|
|
rs = st.executeQuery(sql);
|
|
while (rs.next()) {
|
|
while (rs.next()) {
|
|
r1 = rs.getString(2);
|
|
r1 = rs.getString(2);
|
|
- r2 = rs.getString(4);
|
|
|
|
- r3 = rs.getString(5);
|
|
|
|
|
|
+ r2 = rs.getString(3);
|
|
|
|
+ r3 = rs.getString(4);
|
|
|
|
+ r4 = rs.getString(5);
|
|
// r1 = CryptUtil.decrypt_char(r1==null?"":r1);
|
|
// r1 = CryptUtil.decrypt_char(r1==null?"":r1);
|
|
if (StringUtils.isEmpty(r1)) {
|
|
if (StringUtils.isEmpty(r1)) {
|
|
continue;
|
|
continue;
|
|
@@ -143,8 +148,9 @@ public class CacheFileManager {
|
|
r1 = r1==null?"":r1;
|
|
r1 = r1==null?"":r1;
|
|
r2 = r2==null?"":r2;
|
|
r2 = r2==null?"":r2;
|
|
r3 = r3==null?"":r3;
|
|
r3 = r3==null?"":r3;
|
|
|
|
+ r4 = r4==null?"":r4;
|
|
|
|
|
|
- fw.write(encrypDES.encrytor(r1+ "|" + r2 + "|" + r3));
|
|
|
|
|
|
+ fw.write(encrypDES.encrytor(r1+ "|" + r2 + "|" + r3 + "|" + r4));
|
|
fw.write("\n");
|
|
fw.write("\n");
|
|
}
|
|
}
|
|
fw.close();
|
|
fw.close();
|