Просмотр исходного кода

SendMessage修改,消息发送后的处理交给callback;按profile模式分开不同配置

git-svn-id: svn+ssh://10.10.101.21/source/platform/platform-b2b@4764 f3bf4e98-0cf0-11e4-a00c-a99a8b9d557d
yingp 9 лет назад
Родитель
Сommit
6546f1637c
26 измененных файлов с 261 добавлено и 66 удалено
  1. 3 12
      pom.xml
  2. 22 18
      src/main/java/com/uas/platform/b2b/controller/ServeController.java
  3. 9 0
      src/main/java/com/uas/platform/b2b/manage/service/LogService.java
  4. 6 2
      src/main/java/com/uas/platform/b2b/manage/service/impl/AccessTokenServiceImpl.java
  5. 39 0
      src/main/java/com/uas/platform/b2b/manage/service/impl/LogServiceImpl.java
  6. 5 0
      src/main/java/com/uas/platform/b2b/model/PurchaseInquiry.java
  7. 5 2
      src/main/java/com/uas/platform/b2b/service/impl/ChangeAdminServiceImpl.java
  8. 6 4
      src/main/java/com/uas/platform/b2b/service/impl/EnterpriseServiceImpl.java
  9. 6 5
      src/main/java/com/uas/platform/b2b/service/impl/UserServiceImpl.java
  10. 0 12
      src/main/java/com/uas/platform/b2b/support/HostConstant.java
  11. 63 0
      src/main/java/com/uas/platform/b2b/support/SysConf.java
  12. 12 5
      src/main/java/com/uas/platform/b2b/support/mq/PushUtils.java
  13. 11 2
      src/main/java/com/uas/platform/b2b/support/mq/Pusher.java
  14. 0 0
      src/main/resources/dev/email.properties
  15. 17 0
      src/main/resources/dev/jdbc.properties
  16. 2 0
      src/main/resources/dev/redis.properties
  17. 5 0
      src/main/resources/dev/sys.properties
  18. 5 0
      src/main/resources/prod/email.properties
  19. 3 0
      src/main/resources/prod/jdbc.properties
  20. 0 0
      src/main/resources/prod/redis.properties
  21. 5 0
      src/main/resources/prod/sys.properties
  22. 8 4
      src/main/resources/spring/context.xml
  23. 5 0
      src/main/resources/test/email.properties
  24. 17 0
      src/main/resources/test/jdbc.properties
  25. 2 0
      src/main/resources/test/redis.properties
  26. 5 0
      src/main/resources/test/sys.properties

+ 3 - 12
pom.xml

@@ -16,10 +16,7 @@
 			<!-- 开发环境 -->
 			<id>dev</id>
 			<properties>
-				<!-- jdbc -->
-				<profile-jdbc-url>jdbc:oracle:thin:@192.168.253.6:1521:orcl</profile-jdbc-url>
-				<profile-jdbc-username>uuplatformdemo</profile-jdbc-username>
-				<profile-jdbc-password>selectuuplatform</profile-jdbc-password>
+				<profile>dev</profile>
 				<!-- static plugin -->
 				<static-path>static</static-path>
 			</properties>
@@ -28,10 +25,7 @@
 			<!-- 测试环境 -->
 			<id>test</id>
 			<properties>
-				<!-- jdbc -->
-				<profile-jdbc-url>jdbc:oracle:thin:@192.168.253.6:1521:orcl</profile-jdbc-url>
-				<profile-jdbc-username>uuplatformdemo</profile-jdbc-username>
-				<profile-jdbc-password>selectuuplatform</profile-jdbc-password>
+				<profile>test</profile>
 				<!-- static plugin -->
 				<static-path>static</static-path>
 			</properties>
@@ -40,10 +34,7 @@
 			<!-- 生产环境 -->
 			<id>prod</id>
 			<properties>
-				<!-- jdbc -->
-				<profile-jdbc-url>jdbc:oracle:thin:@10.10.100.200:1521:orcl</profile-jdbc-url>
-				<profile-jdbc-username>platform$b2b</profile-jdbc-username>
-				<profile-jdbc-password>select*fromuu</profile-jdbc-password>
+				<profile>prod</profile>
 				<!-- static plugin -->
 				<static-path>http://static.ubtob.com</static-path>
 			</properties>

+ 22 - 18
src/main/java/com/uas/platform/b2b/controller/ServeController.java

@@ -12,6 +12,7 @@ import org.springframework.ui.ModelMap;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.ResponseBody;
 
+import com.uas.platform.b2b.manage.service.LogService;
 import com.uas.platform.b2b.model.Enterprise;
 import com.uas.platform.b2b.model.RegisterRecord;
 import com.uas.platform.b2b.model.User;
@@ -21,10 +22,13 @@ import com.uas.platform.b2b.service.UserService;
 import com.uas.platform.b2b.support.SystemSession;
 import com.uas.platform.b2b.support.TokenService;
 import com.uas.platform.b2b.support.UsageBufferedLogger;
+import com.uas.platform.core.concurrent.Callback;
 import com.uas.platform.core.logging.BufferedLoggerManager;
 import com.uas.platform.core.util.AgentUtils;
-import com.uas.platform.core.util.SendMessageUtil;
 import com.uas.platform.core.util.StringUtil;
+import com.uas.platform.core.util.mq.MessageLog;
+import com.uas.platform.core.util.mq.MessageType;
+import com.uas.platform.core.util.mq.SendMessageUtil;
 
 /**
  * 优软B2B平台 -- 自助服务功能
@@ -44,9 +48,10 @@ public class ServeController {
 	private RegisterLogService registerLogService;
 	@Autowired
 	private TokenService tokenService;
+	@Autowired
+	private LogService logService;
 
-	private final static UsageBufferedLogger logger = BufferedLoggerManager
-			.getLogger(UsageBufferedLogger.class);
+	private final static UsageBufferedLogger logger = BufferedLoggerManager.getLogger(UsageBufferedLogger.class);
 
 	/**
 	 * 根据用户输入的营业执照号查询用户信息
@@ -65,11 +70,9 @@ public class ServeController {
 			for (User user : users) {
 				ModelMap map = new ModelMap();
 				map.put("userNames", user.getUserName());
-				map.put("userName",
-						StringUtil.getSheildString(user.getUserName(), 1, 1));
+				map.put("userName", StringUtil.getSheildString(user.getUserName(), 1, 1));
 				map.put("userUu", user.getUserUU());
-				map.put("userMail",
-						StringUtil.getSheildString(user.getUserEmail(), 3, 3));
+				map.put("userMail", StringUtil.getSheildString(user.getUserEmail(), 3, 3));
 				listMap.add(map);
 			}
 		} else {
@@ -100,8 +103,7 @@ public class ServeController {
 		if (ens.size() > 0) {
 			for (Enterprise e : ens) {
 				ModelMap map = new ModelMap();
-				map.put("enName",
-						StringUtil.getSheildString(e.getEnName(), 3, 2));
+				map.put("enName", StringUtil.getSheildString(e.getEnName(), 3, 2));
 				long enUu = e.getUu();
 				map.put("enUu", enUu);
 				if (e != null && e.getEnStatus() != null) {
@@ -134,14 +136,17 @@ public class ServeController {
 		Long userUu = userService.findUserByUserTel(userPhone).getUserUU();
 		if (userUu != null) {
 			String code = tokenService.getEncodeToken("mobile", userUu);
+			String userName = (SystemSession.getUser() == null) ? "游客" : SystemSession.getUser().getUserName();
 			try {
-				SendMessageUtil
-						.sendMessage(
-								"验证码:" + code + ",优软商务平台找回密码。",
-								userPhone,
-								(SystemSession.getUser() == null) ? "游客"
-										: SystemSession.getUser().getUserName(),
-								"auth");
+				SendMessageUtil.sendMessage("验证码:" + code + ",优软商务平台找回密码。", userPhone, userName, MessageType.auth,
+						new Callback<MessageLog>() {
+
+							@Override
+							public void call(MessageLog param) throws Exception {
+								logService.saveMessageLog(param);
+							}
+
+						});
 			} catch (Exception e) {
 				e.printStackTrace();
 			}
@@ -176,8 +181,7 @@ public class ServeController {
 
 	@RequestMapping(value = "/forget/resetPwd")
 	@ResponseBody
-	public void setNewPwd(Long userUU, String newPwd, String checkCode,
-			HttpServletRequest request) {
+	public void setNewPwd(Long userUU, String newPwd, String checkCode, HttpServletRequest request) {
 		userService.resetPwdByCheckcode(userUU, newPwd, checkCode);
 		logger.log("用户信息", "手机验证码找回修改用户密码", userUU, AgentUtils.getIp(request));
 	}

+ 9 - 0
src/main/java/com/uas/platform/b2b/manage/service/LogService.java

@@ -0,0 +1,9 @@
+package com.uas.platform.b2b.manage.service;
+
+import com.uas.platform.core.util.mq.MessageLog;
+
+public interface LogService {
+
+	public void saveMessageLog(MessageLog log);
+
+}

+ 6 - 2
src/main/java/com/uas/platform/b2b/manage/service/impl/AccessTokenServiceImpl.java

@@ -3,11 +3,12 @@ package com.uas.platform.b2b.manage.service.impl;
 import java.util.HashMap;
 import java.util.Map;
 
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.http.HttpStatus;
 import org.springframework.stereotype.Service;
 
 import com.uas.platform.b2b.manage.service.AccessTokenService;
-import com.uas.platform.b2b.support.HostConstant;
+import com.uas.platform.b2b.support.SysConf;
 import com.uas.platform.core.exception.SystemException;
 import com.uas.platform.core.util.HttpUtil;
 import com.uas.platform.core.util.HttpUtil.Response;
@@ -16,13 +17,16 @@ import com.uas.platform.core.util.serializer.FlexJsonUtils;
 @Service("manage.AccessTokenServiceImpl")
 public class AccessTokenServiceImpl implements AccessTokenService {
 
+	@Autowired
+	private SysConf sysConf;
+
 	@Override
 	public Map<String, Object> validFormManage(String accessToken) {
 		Map<String, String> params = new HashMap<String, String>();
 		params.put("access_token", accessToken);
 		Response response = null;
 		try {
-			response = HttpUtil.sendGetRequest(HostConstant.MANAGE_INNER_HOST + "/public/token", params);
+			response = HttpUtil.sendGetRequest(sysConf.getManageInner() + "/public/token", params);
 		} catch (Exception e) {
 			return null;
 		}

+ 39 - 0
src/main/java/com/uas/platform/b2b/manage/service/impl/LogServiceImpl.java

@@ -0,0 +1,39 @@
+package com.uas.platform.b2b.manage.service.impl;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.mail.IllegalWriteException;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import com.uas.platform.b2b.manage.service.LogService;
+import com.uas.platform.b2b.support.SysConf;
+import com.uas.platform.core.util.HttpUtil;
+import com.uas.platform.core.util.HttpUtil.Response;
+import com.uas.platform.core.util.mq.MessageLog;
+import com.uas.platform.core.util.serializer.FlexJsonUtils;
+
+@Service
+public class LogServiceImpl implements LogService {
+
+	@Autowired
+	private SysConf sysConf;
+
+	@Override
+	public void saveMessageLog(MessageLog log) {
+		Map<String, String> map = new HashMap<String, String>();
+		String data = FlexJsonUtils.toJson(log);
+		map.put("data", data);
+		try {
+			Response res = HttpUtil.sendGetRequest(sysConf.getManageInner() + "/public/message/log", map, true);
+			if (res.getStatusCode() != 200) {
+				new IllegalWriteException("发送到管理平台保存短信信息报错");
+			}
+		} catch (Exception e) {
+			e.printStackTrace();
+		}
+	}
+
+}

+ 5 - 0
src/main/java/com/uas/platform/b2b/model/PurchaseInquiry.java

@@ -27,6 +27,11 @@ import com.alibaba.fastjson.annotation.JSONField;
 /**
  * 平台里面,以供应商的角度来查看采购询价单
  * 
+ * <pre>
+ * 数据库虚拟列里面用到的函数,是不允许操作动态数据的;原over_sysdate函数用法存在问题;
+ * 改用视图{@code v$purc$inquiry}处理
+ * </pre>
+ * 
  * @author yingp
  * 
  */

+ 5 - 2
src/main/java/com/uas/platform/b2b/service/impl/ChangeAdminServiceImpl.java

@@ -27,8 +27,8 @@ import com.uas.platform.b2b.model.Role;
 import com.uas.platform.b2b.model.User;
 import com.uas.platform.b2b.service.ChangeAdminService;
 import com.uas.platform.b2b.service.UserService;
-import com.uas.platform.b2b.support.HostConstant;
 import com.uas.platform.b2b.support.SendMailService;
+import com.uas.platform.b2b.support.SysConf;
 import com.uas.platform.core.model.Constant;
 import com.uas.platform.core.model.Status;
 import com.uas.platform.core.util.AgentUtils;
@@ -40,6 +40,9 @@ import com.uas.platform.core.util.serializer.FlexJsonUtils;
 @Service
 public class ChangeAdminServiceImpl implements ChangeAdminService {
 
+	@Autowired
+	private SysConf sysConf;
+
 	@Autowired
 	private ChangeAdminDao adminDao;
 
@@ -189,7 +192,7 @@ public class ChangeAdminServiceImpl implements ChangeAdminService {
 	private boolean sendUserToManage(User newUserInfo) throws Exception {
 		Map<String, String> params = new HashMap<String, String>();
 		params.put("data", FlexJsonUtils.toJson(new AccountInfo(newUserInfo)));
-		Response response = HttpUtil.sendPostRequest(HostConstant.MANAGE_INNER_HOST + "/public/account", params, true);
+		Response response = HttpUtil.sendPostRequest(sysConf.getManageInner() + "/public/account", params, true);
 		if (response.getStatusCode() == HttpStatus.OK.value()) {
 			List<Map<String, Object>> resultMap = FlexJsonUtils.fromJsonArray(response.getResponseText(), HashMap.class);
 			if (resultMap.size() > 0) {

+ 6 - 4
src/main/java/com/uas/platform/b2b/service/impl/EnterpriseServiceImpl.java

@@ -33,8 +33,8 @@ import com.uas.platform.b2b.model.RegisterRecord;
 import com.uas.platform.b2b.model.User;
 import com.uas.platform.b2b.service.EnterpriseService;
 import com.uas.platform.b2b.service.UserService;
-import com.uas.platform.b2b.support.HostConstant;
 import com.uas.platform.b2b.support.SendMailService;
+import com.uas.platform.b2b.support.SysConf;
 import com.uas.platform.b2b.support.TokenService;
 import com.uas.platform.core.exception.IllegalOperatorException;
 import com.uas.platform.core.model.Constant;
@@ -49,6 +49,8 @@ import com.uas.platform.core.util.encry.Md5Utils;
 @Service
 public class EnterpriseServiceImpl implements EnterpriseService {
 
+	@Autowired
+	private SysConf sysConf;
 	@Autowired
 	private EnterpriseDao enterpriseDao;
 	@Autowired
@@ -232,7 +234,7 @@ public class EnterpriseServiceImpl implements EnterpriseService {
 	 */
 	private void updateManagePassword(Long enUU, String password) {
 		try {
-			Response response = HttpUtil.sendPostRequest(HostConstant.MANAGE_INNER_HOST + "/public/enterprise/password?enUU=" + enUU
+			Response response = HttpUtil.sendPostRequest(sysConf.getManageInner() + "/public/enterprise/password?enUU=" + enUU
 					+ "&password=" + password, null, true);
 			if (response.getStatusCode() != HttpStatus.OK.value())
 				throw new IllegalOperatorException(response.getResponseText());
@@ -649,8 +651,8 @@ public class EnterpriseServiceImpl implements EnterpriseService {
 
 	@Override
 	public String enNameEnable(String enName) {
-		List<Enterprise> enterprises = enterpriseDao.findByEnNameAndEnStatus(enName, (short)Status.ENABLED.value());
-		if(!CollectionUtils.isEmpty(enterprises)) {
+		List<Enterprise> enterprises = enterpriseDao.findByEnNameAndEnStatus(enName, (short) Status.ENABLED.value());
+		if (!CollectionUtils.isEmpty(enterprises)) {
 			return "UNABLE";
 		} else {
 			return "ENABLE";

+ 6 - 5
src/main/java/com/uas/platform/b2b/service/impl/UserServiceImpl.java

@@ -32,8 +32,8 @@ import com.uas.platform.b2b.model.UserInfo;
 import com.uas.platform.b2b.model.Vendor;
 import com.uas.platform.b2b.service.UserService;
 import com.uas.platform.b2b.service.VendorService;
-import com.uas.platform.b2b.support.HostConstant;
 import com.uas.platform.b2b.support.SendMailService;
+import com.uas.platform.b2b.support.SysConf;
 import com.uas.platform.b2b.support.SystemSession;
 import com.uas.platform.b2b.support.TokenService;
 import com.uas.platform.core.exception.IllegalOperatorException;
@@ -48,6 +48,8 @@ import com.uas.platform.core.util.serializer.FlexJsonUtils;
 @Service
 public class UserServiceImpl implements UserService {
 
+	@Autowired
+	private SysConf sysConf;
 	@Autowired
 	private UserDao userDao;
 	@Autowired
@@ -229,13 +231,12 @@ public class UserServiceImpl implements UserService {
 	 * @param newUserInfo
 	 * @throws Exception
 	 */
-	private static Map<String, Object> sendUserToManage(User newUserInfo) throws Exception {
+	private Map<String, Object> sendUserToManage(User newUserInfo) throws Exception {
 		Map<String, String> params = new HashMap<String, String>();
 		params.put("data", FlexJsonUtils.toJson(new AccountInfo(newUserInfo)));
-		Response response = HttpUtil.sendPostRequest(HostConstant.MANAGE_INNER_HOST + "/public/account", params, true);
+		Response response = HttpUtil.sendPostRequest(sysConf.getManageInner() + "/public/account", params, true);
 		if (response.getStatusCode() == HttpStatus.OK.value()) {
-			List<Map<String, Object>> resultMap = FlexJsonUtils
-					.fromJsonArray(response.getResponseText(), HashMap.class);
+			List<Map<String, Object>> resultMap = FlexJsonUtils.fromJsonArray(response.getResponseText(), HashMap.class);
 			if (resultMap.size() > 0) {
 				if ("true".equals(String.valueOf(resultMap.get(0).get("ok")))) {
 					return resultMap.get(0);

+ 0 - 12
src/main/java/com/uas/platform/b2b/support/HostConstant.java

@@ -2,16 +2,4 @@ package com.uas.platform.b2b.support;
 
 public class HostConstant {
 
-	/**
-	 * 管理平台地址
-	 */
-	public static final String MANAGE_INNER_HOST = "http://10.10.100.81:8080";
-
-	public static final String MANAGE_OUTER_HOST = "http://manage.ubtob.com";
-
-	/**
-	 * B2B地址
-	 */
-	public static final String HOST = "http://www.ubtob.com";
-
 }

+ 63 - 0
src/main/java/com/uas/platform/b2b/support/SysConf.java

@@ -0,0 +1,63 @@
+package com.uas.platform.b2b.support;
+
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Component;
+
+/**
+ * 系统运行参数
+ * 
+ * <pre>
+ * 通过属性文件注入
+ * </pre>
+ * 
+ * @author yingp
+ *
+ */
+@Component
+public class SysConf {
+
+	@Value("#{sys.b2b}")
+	private String b2b;
+
+	@Value("#{sys.manage}")
+	private String manage;
+
+	@Value("#{sys.manageInner}")
+	private String manageInner;
+
+	@Value("#{sys.im}")
+	private String im;
+
+	public String getB2b() {
+		return b2b;
+	}
+
+	public void setB2b(String b2b) {
+		this.b2b = b2b;
+	}
+
+	public String getManage() {
+		return manage;
+	}
+
+	public void setManage(String manage) {
+		this.manage = manage;
+	}
+
+	public String getManageInner() {
+		return manageInner;
+	}
+
+	public void setManageInner(String manageInner) {
+		this.manageInner = manageInner;
+	}
+
+	public String getIm() {
+		return im;
+	}
+
+	public void setIm(String im) {
+		this.im = im;
+	}
+
+}

+ 12 - 5
src/main/java/com/uas/platform/b2b/support/mq/PushUtils.java

@@ -14,7 +14,7 @@ import com.uas.platform.b2b.manage.model.AccountInfo;
 import com.uas.platform.b2b.model.AccessToken;
 import com.uas.platform.b2b.model.UserBaseInfo;
 import com.uas.platform.b2b.service.AccessTokenService;
-import com.uas.platform.b2b.support.HostConstant;
+import com.uas.platform.b2b.support.SysConf;
 import com.uas.platform.core.util.HttpUtil;
 import com.uas.platform.core.util.HttpUtil.Response;
 import com.uas.platform.core.util.serializer.FlexJsonUtils;
@@ -23,6 +23,7 @@ public class PushUtils {
 
 	private static UserBaseInfoDao userRepository;
 	private static AccessTokenService accessTokenService;
+	private static SysConf sysConf;
 
 	private static UserBaseInfoDao getUserRepository() {
 		if (userRepository == null)
@@ -36,6 +37,12 @@ public class PushUtils {
 		return accessTokenService;
 	}
 
+	private static SysConf getSysConf() {
+		if (sysConf == null)
+			sysConf = ContextUtils.getBean(SysConf.class);
+		return sysConf;
+	}
+
 	/**
 	 * 调用接口注册IM
 	 * 
@@ -47,7 +54,7 @@ public class PushUtils {
 	private static Map<String, Object> sendUserToManage(UserBaseInfo user, long enUU) throws Exception {
 		Map<String, String> params = new HashMap<String, String>();
 		params.put("data", FlexJsonUtils.toJson(new AccountInfo(user, enUU)));
-		Response response = HttpUtil.sendPostRequest(HostConstant.MANAGE_INNER_HOST + "/public/account", params, true);
+		Response response = HttpUtil.sendPostRequest(getSysConf().getManageInner() + "/public/account", params, true);
 		if (response.getStatusCode() == HttpStatus.OK.value()) {
 			List<Map<String, Object>> resultMap = FlexJsonUtils.fromJsonArray(response.getResponseText(), HashMap.class);
 			if (resultMap.size() > 0) {
@@ -74,7 +81,7 @@ public class PushUtils {
 				} catch (Exception e) {
 				}
 			}
-			if (user.getUserIMId() != null&&user.getUserIMId()>0) {
+			if (user.getUserIMId() != null && user.getUserIMId() > 0) {
 				Map<String, Object> params = new HashMap<String, Object>();
 				params.put("userid", user.getUserIMId());
 				params.put("enUU", enUU);
@@ -84,8 +91,8 @@ public class PushUtils {
 				AccessToken token = getAccessTokenService().createNew(user, enUU, null, 259200);// 有效期:三天
 				// ex: http://www.ubtob.com/openapi/webpage?access_token=282a8ba2fa1f4fdc9e025c1eea2ad7e8&redirect_page=http%3A%2F%2Fwww.ubtob.com%2F%23sale%2Forder%2F123
 				try {
-					params.put("url", String.format("%s/openapi/webpage?access_token=%s&redirect_page=%s", HostConstant.HOST,
-							token.getId(), URLEncoder.encode(HostConstant.HOST + "/" + url, "utf-8")));
+					params.put("url", String.format("%s/openapi/webpage?access_token=%s&redirect_page=%s", getSysConf().getB2b(),
+							token.getId(), URLEncoder.encode(getSysConf().getB2b() + "/" + url, "utf-8")));
 					// 调用推送接口
 					Pusher.push(params);
 				} catch (UnsupportedEncodingException e) {

+ 11 - 2
src/main/java/com/uas/platform/b2b/support/mq/Pusher.java

@@ -2,12 +2,21 @@ package com.uas.platform.b2b.support.mq;
 
 import java.util.Map;
 
-import com.uas.platform.core.model.Constant;
+import com.uas.platform.b2b.core.util.ContextUtils;
+import com.uas.platform.b2b.support.SysConf;
 import com.uas.platform.core.util.HttpUtil;
 
 public class Pusher {
 
-	private final static String api = Constant.PUSH_WEBSITE + "/tigase/baiduPush";
+	private static SysConf sysConf;
+
+	private static SysConf getSysConf() {
+		if (sysConf == null)
+			sysConf = ContextUtils.getBean(SysConf.class);
+		return sysConf;
+	}
+
+	private final static String api = getSysConf().getIm() + "/tigase/baiduPush";
 
 	public static void push(Map<String, Object> params) {
 		try {

+ 0 - 0
src/main/resources/email.properties → src/main/resources/dev/email.properties


+ 17 - 0
src/main/resources/dev/jdbc.properties

@@ -0,0 +1,17 @@
+jdbc.driverClassName=oracle.jdbc.driver.OracleDriver
+jdbc.url=jdbc:oracle:thin:@192.168.253.6:1521:orcl
+jdbc.username=uuplatformdemo
+jdbc.password=selectuuplatform
+jdbc.initialSize=10
+jdbc.maxActive=100
+jdbc.maxIdle=50
+jdbc.minIdle=50
+jdbc.suspectTimeout=60
+jdbc.timeBetweenEvictionRunsMillis=30000
+jdbc.minEvictableIdleTimeMillis=60000
+
+#manage.ubtob.com
+manage.jdbc.driverClassName=oracle.jdbc.driver.OracleDriver
+manage.jdbc.url=jdbc:oracle:thin:@192.168.253.6:1521:orcl
+manage.jdbc.username=platformmanager$test
+manage.jdbc.password=select!#%*(

+ 2 - 0
src/main/resources/dev/redis.properties

@@ -0,0 +1,2 @@
+redis.host=192.168.253.111
+redis.port=6379

+ 5 - 0
src/main/resources/dev/sys.properties

@@ -0,0 +1,5 @@
+#path
+b2b=http://218.17.158.219:9090/platform-b2b
+manage=http://218.17.158.219:9090/platform-manage
+manageInner=http://192.168.253.60:9090/platform-manage
+im=http://113.105.74.131:8092

+ 5 - 0
src/main/resources/prod/email.properties

@@ -0,0 +1,5 @@
+email.host=smtp.mxhichina.com
+email.port=25
+email.username=admin@usoftchina.com
+email.password=Youruan888
+email.from=admin@usoftchina.com

+ 3 - 0
src/main/resources/jdbc.properties → src/main/resources/prod/jdbc.properties

@@ -1,4 +1,7 @@
 jdbc.driverClassName=oracle.jdbc.driver.OracleDriver
+jdbc.url=jdbc:oracle:thin:@10.10.100.200:1521:orcl
+jdbc.username=platform$b2b
+jdbc.password=select*fromuu
 jdbc.initialSize=10
 jdbc.maxActive=100
 jdbc.maxIdle=50

+ 0 - 0
src/main/resources/redis.properties → src/main/resources/prod/redis.properties


+ 5 - 0
src/main/resources/prod/sys.properties

@@ -0,0 +1,5 @@
+#path
+b2b=http://www.ubtob.com
+manage=http://manage.ubtob.com
+manageInner=http://10.10.100.81:8080
+im=http://113.105.74.140:8092

+ 8 - 4
src/main/resources/spring/context.xml

@@ -10,7 +10,11 @@
 	http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-4.1.xsd
 	http://www.springframework.org/schema/cache http://www.springframework.org/schema/cache/spring-cache-3.1.xsd">
 
-	<context:property-placeholder location="classpath*:*.properties" />
+	<context:property-placeholder location="classpath*:${profile}/*.properties" />
+
+	<!-- 系统运行参数注入 -->
+	<util:properties id="sys"
+		location="classpath:${profile}/sys.properties" />
 
 	<bean class="com.uas.platform.b2b.core.support.ApplicationContextRegister" />
 
@@ -59,9 +63,9 @@
 	<bean id="defaultDataSource" class="org.apache.commons.dbcp.BasicDataSource"
 		destroy-method="close">
 		<property name="driverClassName" value="${jdbc.driverClassName}" />
-		<property name="url" value="${profile-jdbc-url}" />
-		<property name="username" value="${profile-jdbc-username}" />
-		<property name="password" value="${profile-jdbc-password}" />
+		<property name="url" value="${jdbc.url}" />
+		<property name="username" value="${jdbc.username}" />
+		<property name="password" value="${jdbc.password}" />
 		<!-- 连接初始值,连接池启动时创建的连接数量的初始值 -->
 		<property name="initialSize" value="${jdbc.initialSize}" />
 		<!-- 连接池的最大值,同一时间可以从池分配的最多连接数量,0时无限制 -->

+ 5 - 0
src/main/resources/test/email.properties

@@ -0,0 +1,5 @@
+email.host=smtp.mxhichina.com
+email.port=25
+email.username=admin@usoftchina.com
+email.password=Youruan888
+email.from=admin@usoftchina.com

+ 17 - 0
src/main/resources/test/jdbc.properties

@@ -0,0 +1,17 @@
+jdbc.driverClassName=oracle.jdbc.driver.OracleDriver
+jdbc.url=jdbc:oracle:thin:@192.168.253.6:1521:orcl
+jdbc.username=uuplatformdemo
+jdbc.password=selectuuplatform
+jdbc.initialSize=10
+jdbc.maxActive=100
+jdbc.maxIdle=50
+jdbc.minIdle=50
+jdbc.suspectTimeout=60
+jdbc.timeBetweenEvictionRunsMillis=30000
+jdbc.minEvictableIdleTimeMillis=60000
+
+#manage.ubtob.com
+manage.jdbc.driverClassName=oracle.jdbc.driver.OracleDriver
+manage.jdbc.url=jdbc:oracle:thin:@192.168.253.6:1521:orcl
+manage.jdbc.username=platformmanager$test
+manage.jdbc.password=select!#%*(

+ 2 - 0
src/main/resources/test/redis.properties

@@ -0,0 +1,2 @@
+redis.host=192.168.253.111
+redis.port=6379

+ 5 - 0
src/main/resources/test/sys.properties

@@ -0,0 +1,5 @@
+#path
+b2b=http://218.17.158.219:9090/platform-b2b
+manage=http://218.17.158.219:9090/platform-manage
+manageInner=http://192.168.253.60:9090/platform-manage
+im=http://113.105.74.131:8092