|
|
@@ -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("收货地址有误,请重新输入收货地址");
|
|
|
}
|
|
|
}
|