配置未文件的内容common-web.properties
#未就诊#
reserve.notSeeDoctor=0
#已就诊
reserve.seeDoctor=1
#已取消
reserve.cancel=9
#已停诊
reserve.stopClinic=4
#逾期未就诊
reserve.overdue=5
#已回转
reserve.backReferral=6
#已离院
reserve.outPatient=7
#预约不存在
reserve.nonentity=-1
##regType
specialist=01
general=02
other=09
###period
am=a
pm=p
######################默认密码#############
default.pwd=123456
######################短信内容#############
sms.reserve.reg.create=您预约的{0}{1}门诊已预约成功,您的预约日期为{2},就诊卡号为{3},请您及时就诊。
sms.reserve.exam.create=您预约的{0}{1}检查已预约成功,您的预约日期为{2},就诊卡号为{3},请您及时就诊。
sms.reserve.reg.cancel=您已经成功取消了{0}{1}{2}的门诊
sms.reserve.exam.cancel=您已经成功取消了{0}{1}{2}的检查
sms.referral.sucess = 您上转成功!上转医院:{0} 预约时间:{1} 就诊卡号:{2}
读取配置问价的源码
如何使用
#未就诊#
reserve.notSeeDoctor=0
#已就诊
reserve.seeDoctor=1
#已取消
reserve.cancel=9
#已停诊
reserve.stopClinic=4
#逾期未就诊
reserve.overdue=5
#已回转
reserve.backReferral=6
#已离院
reserve.outPatient=7
#预约不存在
reserve.nonentity=-1
##regType
specialist=01
general=02
other=09
###period
am=a
pm=p
######################默认密码#############
default.pwd=123456
######################短信内容#############
sms.reserve.reg.create=您预约的{0}{1}门诊已预约成功,您的预约日期为{2},就诊卡号为{3},请您及时就诊。
sms.reserve.exam.create=您预约的{0}{1}检查已预约成功,您的预约日期为{2},就诊卡号为{3},请您及时就诊。
sms.reserve.reg.cancel=您已经成功取消了{0}{1}{2}的门诊
sms.reserve.exam.cancel=您已经成功取消了{0}{1}{2}的检查
sms.referral.sucess = 您上转成功!上转医院:{0} 预约时间:{1} 就诊卡号:{2}
读取配置问价的源码
package com.founder.rcp.common;
import java.io.IOException;
import java.util.Properties;
import org.springframework.core.io.ClassPathResource;
public class ConfigurationHelper {
private static final String WEBSERVICE_CONFIG_FILE = "config/common-web.properties";
private static String dbUrl;
private static String driver;
private static String userName;
private static String password;
private static String reserveNotSeeDoctor;
private static String reserveSeeDoctor;
private static String reserveCancel;
private static String reserveStopClinic;
private static String reserveOverdue;
private static String reserveBackReferral;
private static String reserveOutPatient;
private static String reserveNonentity;
//挂号号别
private static String specialist;//专家门诊
private static String general;//普通门诊
private static String other;//其它
private static String empiWebServiceURL;
static {
ClassPathResource cr = new ClassPathResource(WEBSERVICE_CONFIG_FILE);//
Properties webServiceProperties = new Properties();
try {
webServiceProperties.load(cr.getInputStream());
reserveNotSeeDoctor = webServiceProperties.getProperty("reserve.notSeeDoctor");
reserveSeeDoctor = webServiceProperties.getProperty("reserve.seeDoctor");
reserveCancel = webServiceProperties.getProperty("reserve.cancel");
reserveStopClinic = webServiceProperties.getProperty("reserve.stopClinic");
reserveOverdue = webServiceProperties.getProperty("reserve.overdue");
reserveBackReferral = webServiceProperties.getProperty("reserve.backReferral");
reserveOutPatient = webServiceProperties.getProperty("reserve.outPatient");
reserveNonentity = webServiceProperties.getProperty("reserve.nonentity");
specialist = webServiceProperties.getProperty("specialist");
general = webServiceProperties.getProperty("general");
other = webServiceProperties.getProperty("other");
empiWebServiceURL = webServiceProperties.getProperty("empi.web.service.url");
} catch (IOException ex) {
throw new RuntimeException("Cannot find Configuration " + ConfigurationHelper.WEBSERVICE_CONFIG_FILE);
}
}
public static String getTomcatPath(){
try {
String path = ConfigurationHelper.class.getClassLoader().getResource("").getPath();
int pos=path.lastIndexOf("/", path.length()-2);
path=path.substring(0, pos+1);
return path;
} catch (Exception e) {
return "";
}
}
public static String getDbUrl() {
return dbUrl;
}
public static String getDriver() {
return driver;
}
public static String getUserName() {
return userName;
}
public static String getPassword() {
return password;
}
public static String getReserveNotSeeDoctor() {
return reserveNotSeeDoctor;
}
public static String getReserveSeeDoctor() {
return reserveSeeDoctor;
}
public static String getReserveCancel() {
return reserveCancel;
}
public static String getReserveStopClinic() {
return reserveStopClinic;
}
public static String getReserveOverdue() {
return reserveOverdue;
}
public static String getReserveBackReferral() {
return reserveBackReferral;
}
public static String getReserveOutPatient() {
return reserveOutPatient;
}
public static String getSpecialist() {
return specialist;
}
public static void setSpecialist(String specialist) {
ConfigurationHelper.specialist = specialist;
}
public static String getGeneral() {
return general;
}
public static void setGeneral(String general) {
ConfigurationHelper.general = general;
}
public static String getOther() {
return other;
}
public static void setOther(String other) {
ConfigurationHelper.other = other;
}
public static String getEmpiWebServiceURL() {
return empiWebServiceURL;
}
public static String getReserveNonentity() {
return reserveNonentity;
}
}
如何使用
String urlStr = ConfigurationHelper.getReserveNonentity();