Authored by mali

Merge branch 'gray' into test6.9.8

@@ -13,6 +13,8 @@ import java.util.Map; @@ -13,6 +13,8 @@ import java.util.Map;
13 import java.util.Set; 13 import java.util.Set;
14 import java.util.stream.Collectors; 14 import java.util.stream.Collectors;
15 15
  16 +import com.alibaba.fastjson.JSON;
  17 +import com.alibaba.fastjson.JSONObject;
16 import com.yohobuy.ufo.model.order.bo.SellerBo; 18 import com.yohobuy.ufo.model.order.bo.SellerBo;
17 import org.apache.commons.collections.CollectionUtils; 19 import org.apache.commons.collections.CollectionUtils;
18 import org.apache.commons.collections.map.HashedMap; 20 import org.apache.commons.collections.map.HashedMap;
@@ -928,7 +930,7 @@ public class ProductServiceImpl implements IProductService, ApplicationContextAw @@ -928,7 +930,7 @@ public class ProductServiceImpl implements IProductService, ApplicationContextAw
928 } 930 }
929 return new ApiResponse<>(200, "查询成功", item); 931 return new ApiResponse<>(200, "查询成功", item);
930 } 932 }
931 - 933 + private static final int HK_AREA_CODE = 852;
932 @Override 934 @Override
933 public ApiResponse<Integer> batchImportFromXls(MultipartFile file, Integer editUid) throws Exception { 935 public ApiResponse<Integer> batchImportFromXls(MultipartFile file, Integer editUid) throws Exception {
934 LOGGER.info("用户{}开始导入商品数据!", editUid); 936 LOGGER.info("用户{}开始导入商品数据!", editUid);
@@ -1125,8 +1127,11 @@ public class ProductServiceImpl implements IProductService, ApplicationContextAw @@ -1125,8 +1127,11 @@ public class ProductServiceImpl implements IProductService, ApplicationContextAw
1125 AddressInfo addressHidden = null; 1127 AddressInfo addressHidden = null;
1126 if(userResp.isLargeSettlementSuper()) { 1128 if(userResp.isLargeSettlementSuper()) {
1127 address = new AddressInfo(); 1129 address = new AddressInfo();
  1130 + String areaCode = String.valueOf(HK_AREA_CODE);
  1131 + address.setAreaCode(areaCode);
1128 address.setAddress("香港客户地址"); 1132 address.setAddress("香港客户地址");
1129 addressHidden = new AddressInfo(); 1133 addressHidden = new AddressInfo();
  1134 + addressHidden.setAreaCode(areaCode);
1130 addressHidden.setAddress("香港客户地址"); 1135 addressHidden.setAddress("香港客户地址");
1131 } else { 1136 } else {
1132 try { 1137 try {
@@ -1186,13 +1191,16 @@ public class ProductServiceImpl implements IProductService, ApplicationContextAw @@ -1186,13 +1191,16 @@ public class ProductServiceImpl implements IProductService, ApplicationContextAw
1186 ApiResponse response = null; 1191 ApiResponse response = null;
1187 try { 1192 try {
1188 LOGGER.info("batch import send taskId={}, batchId={}", tran.getId(), (i + 1)); 1193 LOGGER.info("batch import send taskId={}, batchId={}", tran.getId(), (i + 1));
1189 - response = serviceCaller.call("ufo-gateway.batchImportPrds", batchReq, ApiResponse.class, 10);  
1190 - LOGGER.info("batch import send success taskId={}, batchId={}", tran.getId(), (i + 1)); 1194 + JSONObject res = serviceCaller.call("ufo-gateway.batchImportPrds", batchReq, JSONObject.class, 10);
  1195 + LOGGER.info("batch import send success taskId={}, batchId={}, resp={}", tran.getId(), (i + 1), res);
  1196 + if (res != null) {
  1197 + response = res.toJavaObject(ApiResponse.class);
  1198 + }
1191 } catch (Exception e) { 1199 } catch (Exception e) {
1192 LOGGER.info("batch import send failed taskId={}, batchId={}, err={}", tran.getId(), (i + 1), e); 1200 LOGGER.info("batch import send failed taskId={}, batchId={}, err={}", tran.getId(), (i + 1), e);
1193 } 1201 }
1194 if (response != null && response.getCode() != 200) { 1202 if (response != null && response.getCode() != 200) {
1195 - LOGGER.info("batch import send failed broke taskId={}, batchId={}, resp={}", tran.getId(), (i + 1), response); 1203 + LOGGER.info("batch import send failed broke taskId={}, batchId={}, respObj={}", tran.getId(), (i + 1), JSON.toJSONString(response));
1196 throw new PlatformException("导入出错:" + response.getMessage(), response.getCode()); 1204 throw new PlatformException("导入出错:" + response.getMessage(), response.getCode());
1197 } 1205 }
1198 } 1206 }