Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
dc-java
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
bltdc
dc-java
Commits
185b8418
Commit
185b8418
authored
Jul 18, 2019
by
wutong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修复SKU不存在导致的异常问题
parent
d06f3122
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
9 deletions
+11
-9
OrderSyncJob.java
...s-order/src/main/java/com/bailuntec/job/OrderSyncJob.java
+10
-8
OmsOrderTest.java
...-base/base-sync-oms-order/src/test/java/OmsOrderTest.java
+1
-1
No files found.
data-base/base-sync-oms-order/src/main/java/com/bailuntec/job/OrderSyncJob.java
View file @
185b8418
...
...
@@ -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
();
}
...
...
data-base/base-sync-oms-order/src/test/java/OmsOrderTest.java
View file @
185b8418
...
...
@@ -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-18794028960
06"
);
map
.
put
(
"OriginOrderNo"
,
"
402-0458942-30603
06"
);
Request
request
=
new
Request
.
Builder
()
.
get
()
.
url
(
OkHttpUtil
.
attachHttpGetParams
(
"http://oms.bailuntec.com/apiV2/bailunOrder/getBailunOrders"
,
map
))
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment