Commit 185b8418 by wutong

修复SKU不存在导致的异常问题

parent d06f3122
......@@ -11,6 +11,7 @@ import com.bailuntec.domain.pojo.*;
import com.bailuntec.mapper.*;
import com.bailuntec.support.CallBailunSystem;
import com.bailuntec.support.PointJob;
import com.bailuntec.utils.ExceptionUtil;
import com.bailuntec.utils.OkHttpUtil;
import com.bailuntec.utils.PropertiesUtil;
import com.bailuntec.utils.SessionUtil;
......@@ -56,7 +57,7 @@ public class OrderSyncJob extends PointJob {
response = okHttpClient.newCall(request).execute();
omsResultStr = response.body().string();
} catch (IOException e) {
throw new RuntimeException(map + "请求OMS接口同步百伦接口失败" + response, e);
throw new RuntimeException(ExceptionUtil.transform(e),e);
} finally {
if (response != null) {
response.close();
......@@ -84,7 +85,7 @@ public class OrderSyncJob extends PointJob {
mapper.upsertSelective(jobPointLog);
} catch (Exception e) {
e.printStackTrace();
throw new RuntimeException("Mybatis操作DB插入任务记录失败", e);
throw new RuntimeException(ExceptionUtil.transform(e), e);
} finally {
SessionUtil.closeSession();
}
......@@ -306,7 +307,7 @@ public class OrderSyncJob extends PointJob {
BigDecimal rmbCost = BigDecimal.ZERO;
BigDecimal skuAmountGeneralCargo = BigDecimal.ZERO;
//货值= 售价-物流-平台费,只有普货才算货值, 不发货也算货值-- 这里放单个SKU的货值
if (bailunSkuStructure.getGeneralCargo()) {
if (bailunSkuStructure.getGeneralCargo() != null && bailunSkuStructure.getGeneralCargo()) {
skuAmountGeneralCargo = skuAmountProductRMB.subtract(skuCostLogistics).subtract(skuCostPlatformFeeRMB);
totalAmountGeneralCargo = totalAmountGeneralCargo.add(skuAmountGeneralCargo);
}
......@@ -433,7 +434,8 @@ public class OrderSyncJob extends PointJob {
}
}
} catch (Exception e) {
throw new RuntimeException("Mybatis操作DB失败" + e.getCause().getMessage(), e);
e.printStackTrace();
throw new RuntimeException(ExceptionUtil.transform(e), e);
} finally {
SessionUtil.closeSession();
}
......@@ -598,7 +600,7 @@ public class OrderSyncJob extends PointJob {
// DcBaseCrmRefundMapper crmRefundMapper = SessionUtil.getSession().getMapper(DcBaseCrmRefundMapper.class);
// crmRefundMapper.updateLinked(dcBaseOmsOrder.getOriginOrderId(), dcBaseOmsOrder.getBailunAccountId());
} catch (Exception e) {
throw new RuntimeException("Mybatis操作DB失败", e);
throw new RuntimeException(ExceptionUtil.transform(e), e);
} finally {
SessionUtil.closeSession();
}
......@@ -711,7 +713,7 @@ public class OrderSyncJob extends PointJob {
}
} catch (Exception e) {
e.printStackTrace();
throw new RuntimeException("MYBATIS操作DB查询仓库信息失败", e);
throw new RuntimeException(ExceptionUtil.transform(e), e);
} finally {
SessionUtil.closeSession();
}
......@@ -805,7 +807,7 @@ public class OrderSyncJob extends PointJob {
}
} catch (Exception e) {
e.printStackTrace();
throw new RuntimeException("MYBATIS操作DB失败", e);
throw new RuntimeException(ExceptionUtil.transform(e), e);
} finally {
SessionUtil.closeSession();
}
......@@ -851,7 +853,7 @@ public class OrderSyncJob extends PointJob {
skuProductInfo = dcBaseSkuMapper.selectOneByExample(DcBaseSkuExample.newAndCreateCriteria().andBailunSkuEqualTo(bailunSku.getBailunSku()).example());
} catch (Exception e) {
e.printStackTrace();
throw new RuntimeException("MYBATIS查询DB失败");
throw new RuntimeException(ExceptionUtil.transform(e),e);
} finally {
SessionUtil.closeSession();
}
......
......@@ -73,7 +73,7 @@ public class OmsOrderTest {
LinkedHashMap<String, String> map = new LinkedHashMap<>(4);
map.put("pageIndex", "1");
map.put("pageCount", "100");
map.put("OriginOrderNo", "163763969786-1879402896006");
map.put("OriginOrderNo", "402-0458942-3060306");
Request request = new Request.Builder()
.get()
.url(OkHttpUtil.attachHttpGetParams("http://oms.bailuntec.com/apiV2/bailunOrder/getBailunOrders", map))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment