Authored by mali

Merge branch 'gray' into test6.9.8

... ... @@ -13,6 +13,8 @@ import java.util.Map;
import java.util.Set;
import java.util.stream.Collectors;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.yohobuy.ufo.model.order.bo.SellerBo;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.collections.map.HashedMap;
... ... @@ -928,7 +930,7 @@ public class ProductServiceImpl implements IProductService, ApplicationContextAw
}
return new ApiResponse<>(200, "查询成功", item);
}
private static final int HK_AREA_CODE = 852;
@Override
public ApiResponse<Integer> batchImportFromXls(MultipartFile file, Integer editUid) throws Exception {
LOGGER.info("用户{}开始导入商品数据!", editUid);
... ... @@ -1125,8 +1127,11 @@ public class ProductServiceImpl implements IProductService, ApplicationContextAw
AddressInfo addressHidden = null;
if(userResp.isLargeSettlementSuper()) {
address = new AddressInfo();
String areaCode = String.valueOf(HK_AREA_CODE);
address.setAreaCode(areaCode);
address.setAddress("香港客户地址");
addressHidden = new AddressInfo();
addressHidden.setAreaCode(areaCode);
addressHidden.setAddress("香港客户地址");
} else {
try {
... ... @@ -1186,13 +1191,16 @@ public class ProductServiceImpl implements IProductService, ApplicationContextAw
ApiResponse response = null;
try {
LOGGER.info("batch import send taskId={}, batchId={}", tran.getId(), (i + 1));
response = serviceCaller.call("ufo-gateway.batchImportPrds", batchReq, ApiResponse.class, 10);
LOGGER.info("batch import send success taskId={}, batchId={}", tran.getId(), (i + 1));
JSONObject res = serviceCaller.call("ufo-gateway.batchImportPrds", batchReq, JSONObject.class, 10);
LOGGER.info("batch import send success taskId={}, batchId={}, resp={}", tran.getId(), (i + 1), res);
if (res != null) {
response = res.toJavaObject(ApiResponse.class);
}
} catch (Exception e) {
LOGGER.info("batch import send failed taskId={}, batchId={}, err={}", tran.getId(), (i + 1), e);
}
if (response != null && response.getCode() != 200) {
LOGGER.info("batch import send failed broke taskId={}, batchId={}, resp={}", tran.getId(), (i + 1), response);
LOGGER.info("batch import send failed broke taskId={}, batchId={}, respObj={}", tran.getId(), (i + 1), JSON.toJSONString(response));
throw new PlatformException("导入出错:" + response.getMessage(), response.getCode());
}
}
... ...