Browse Source

删除dubbo依赖

suntg 8 years ago
parent
commit
bf5aca46af

+ 1 - 23
pom.xml

@@ -354,29 +354,7 @@
 			 <artifactId>spring-kafka</artifactId>
 			<version>1.2.2.RELEASE</version>
 		 </dependency>
-		<!-- dubbo -->
-		<dependency>
-			<groupId>com.alibaba</groupId>
-			<artifactId>dubbo</artifactId>
-			<exclusions>
-				<exclusion>
-					<groupId>javax.servlet</groupId>
-					<artifactId>javax.servlet-api</artifactId>
-				</exclusion>
-				<exclusion>
-					<groupId>org.apache.httpcomponents</groupId>
-					<artifactId>httpcore</artifactId>
-				</exclusion>
-			</exclusions>
-		</dependency>
-		<dependency>
-			<groupId>org.apache.zookeeper</groupId>
-			<artifactId>zookeeper</artifactId>
-		</dependency>
-		<dependency>
-			<groupId>com.github.sgroschupf</groupId>
-			<artifactId>zkclient</artifactId>
-		</dependency>
+
 		<!-- service on dubbo -->
 		<dependency>
 			<groupId>com.uas.dfs</groupId>

+ 1 - 1
src/main/java/com/uas/platform/b2c/external/erp/order/api/OrderController.java

@@ -1,6 +1,5 @@
 package com.uas.platform.b2c.external.erp.order.api;
 
-import com.alibaba.dubbo.common.utils.StringUtils;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.uas.platform.b2c.common.account.model.Enterprise;
@@ -22,6 +21,7 @@ import com.uas.platform.core.model.Status;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.data.domain.Page;
 import org.springframework.ui.ModelMap;
+import org.springframework.util.StringUtils;
 import org.springframework.web.bind.annotation.*;
 
 import javax.management.OperationsException;

+ 1 - 1
src/main/java/com/uas/platform/b2c/fa/settlement/service/impl/BillSubmitServiceImpl.java

@@ -81,7 +81,7 @@ public class BillSubmitServiceImpl implements BillSubmitService {
             }
             orderidList.removeAll(orderIds);
 
-            String errorIdStr = com.alibaba.dubbo.common.utils.StringUtils.join(orderids, SplitChar.COMMA);
+            String errorIdStr = org.apache.commons.lang3.StringUtils.join(orderids, SplitChar.COMMA);
             throw new IllegalOperatorException("订单号: " + errorIdStr + " 不存在,请重新确认订单信息");
         }
 

+ 1 - 1
src/main/java/com/uas/platform/b2c/logistics/service/impl/LogisticsCompanyCodeServiceImpl.java

@@ -6,11 +6,11 @@ import java.util.List;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
-import com.alibaba.dubbo.common.utils.CollectionUtils;
 import com.uas.platform.b2c.logistics.dao.LogisticsCompanyCodeDao;
 import com.uas.platform.b2c.logistics.model.LogisticsCompanyCode;
 import com.uas.platform.b2c.logistics.service.LogisticsCompanyCodeService;
 import com.uas.platform.core.exception.IllegalOperatorException;
+import org.springframework.util.CollectionUtils;
 
 @Service
 public class LogisticsCompanyCodeServiceImpl implements LogisticsCompanyCodeService {

+ 1 - 1
src/main/java/com/uas/platform/b2c/trade/order/controller/OrderController.java

@@ -1,6 +1,5 @@
 package com.uas.platform.b2c.trade.order.controller;
 
-import com.alibaba.dubbo.common.utils.StringUtils;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.uas.platform.b2c.common.account.model.Enterprise;
@@ -28,6 +27,7 @@ import com.uas.platform.core.model.Status;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.data.domain.Page;
 import org.springframework.ui.ModelMap;
+import org.springframework.util.StringUtils;
 import org.springframework.web.bind.annotation.PathVariable;
 import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;

+ 5 - 14
src/main/java/com/uas/platform/b2c/trade/order/service/impl/OrderServiceImpl.java

@@ -1,7 +1,6 @@
 package com.uas.platform.b2c.trade.order.service.impl;
 
-import com.alibaba.dubbo.common.json.JSON;
-import com.alibaba.dubbo.common.json.ParseException;
+import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.uas.api.b2c_erp.buyer.model.B2cOrder;
@@ -960,18 +959,10 @@ public class OrderServiceImpl implements OrderService {
         String jsonAddress = null;
         if (Type.Delivery_ByUU_Code.value() == deliveryType) {
             Address address = addressDao.findOne(id);
-            try {
-                jsonAddress = JSON.json(address);
-            } catch (IOException e) {
-                e.printStackTrace();
-            }
+            jsonAddress = FastjsonUtils.toJson(address);
         } else if (Type.Delivery_BySelf_Code.value() == deliveryType) { // 1302:上门自提
             PickUpAddress address = pickUpAddressDao.findOne(id);
-            try {
-                jsonAddress = JSON.json(address);
-            } catch (IOException e) {
-                e.printStackTrace();
-            }
+            jsonAddress = FastjsonUtils.toJson(address);
         }
         return jsonAddress;
     }
@@ -1123,14 +1114,14 @@ public class OrderServiceImpl implements OrderService {
             throw new IllegalOperatorException("收货地址有误,请重新输入收货地址");
         }
         try {
-            Address address = JSON.parse(jsonAddress, Address.class);
+            Address address = FastjsonUtils.fromJson(jsonAddress, Address.class);
             if (address.getArea().startsWith("香港") && order.getCurrency().equalsIgnoreCase("RMB")) {// area包含:省市区
                 throw new IllegalOperatorException("币别与收货地址不一致,香港只能以美元购买商品,不能是人民币,请刷新页面重新确认订单");
             }
             if (!address.getArea().startsWith("香港") && order.getCurrency().equalsIgnoreCase("USD")) {
                 throw new IllegalOperatorException("币别与收货地址不一致,大陆只能以人民币购买商品,不能是美元,请刷新页面重新确认订单");
             }
-        } catch (ParseException e) {
+        } catch (Exception e) {
             throw new IllegalOperatorException("收货地址有误,请重新输入收货地址");
         }
     }

+ 1 - 1
src/main/java/com/uas/platform/b2c/trade/presale/service/impl/CartServiceImpl.java

@@ -1,6 +1,5 @@
 package com.uas.platform.b2c.trade.presale.service.impl;
 
-import com.alibaba.dubbo.common.utils.StringUtils;
 import com.uas.platform.b2c.common.account.dao.EnterpriseDao;
 import com.uas.platform.b2c.common.account.model.Enterprise;
 import com.uas.platform.b2c.common.account.model.User;
@@ -35,6 +34,7 @@ import org.springframework.data.jpa.domain.Specification;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.util.CollectionUtils;
+import org.springframework.util.StringUtils;
 
 import javax.persistence.criteria.CriteriaBuilder;
 import javax.persistence.criteria.CriteriaQuery;

+ 1 - 1
src/main/resources/log4j.properties

@@ -9,7 +9,7 @@ log4j.appender.stdout.layout.ConversionPattern=%d %p [%c]:%m%n
 log4j.appender.logfile=org.apache.log4j.RollingFileAppender
 log4j.appender.logfile.layout=org.apache.log4j.PatternLayout
 #log4j.appender.logfile.File=../log4j.log
-log4j.appender.logfile.File=../logs/b2c_log4j.log
+log4j.appender.logfile.File=$CATALINA_BASE/logs/b2c_log4j.log
 # Keep three backup files.
 log4j.appender.logfile.MaxBackupIndex=3
 log4j.appender.logfile.MaxFileSize=5120KB

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

@@ -3,9 +3,9 @@
 #jdbc.username=platform$b2b
 #jdbc.password=select*fromuu
 jdbc.driverClassName=com.mysql.jdbc.Driver
-jdbc.url=jdbc:mysql://10.10.100.18:3306/mall_prod?characterEncoding=UTF-8
-jdbc.username=root
-jdbc.password=select
+jdbc.url=jdbc:mysql://10.10.0.208:3306/mall_prod?characterEncoding=UTF-8
+jdbc.username=sa
+jdbc.password=Select123!#%*(
 jdbc.initialSize=1
 jdbc.maxActive=100
 jdbc.maxIdle=50

+ 0 - 1
src/test/java/com/uas/platform/b2c/RegistForMall.java

@@ -1,6 +1,5 @@
 package com.uas.platform.b2c;
 
-import com.alibaba.dubbo.common.json.JSONObject;
 import com.uas.platform.b2c.core.utils.FastjsonUtils;
 import org.apache.commons.collections.map.HashedMap;