Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
sibu-v-mall
/
sibu-v-mall-third-api
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
构建
提交
问题看板
文件
提交
网络
比较
分支
标签
5ae8e917
由
刘嘉
编写于
2018-05-16 10:48:23 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
菠萝派接口- 更新库存修改
1 个父辈
fd096c00
显示空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
9 行增加
和
9 行删除
com.sibu.orderHelper.service/src/main/java/com/sibu/orderHelper/integral/service/pineapple/impl/SyncStockBizServiceImpl.java
com.sibu.orderHelper.service/src/main/java/com/sibu/orderHelper/integral/service/pineapple/impl/SyncStockBizServiceImpl.java
查看文件 @
5ae8e91
...
...
@@ -32,28 +32,28 @@ public class SyncStockBizServiceImpl extends AbstractBizService<PineappleSyncSto
public
PineappleSyncStockResponse
call
(
CallRequest
<
PineappleSyncStockRequest
>
callRequest
)
throws
Exception
{
PineappleSyncStockResponse
pineappleSyncStockResponse
=
new
PineappleSyncStockResponse
();
if
(
callRequest
.
getBizModel
().
getQuantity
()
<
0
){
log
.
error
(
String
.
format
(
"菠萝派商城appkey[%s]更新库存失败,库存必须大于或等于0,商品ID是:
%s
"
,
callRequest
.
getRequest
().
getAppkey
(),
callRequest
.
getBizModel
().
getPlatProductID
()));
throw
new
BizException
(
String
.
format
(
"菠萝派商城appkey[%s]更新库存失败,库存必须大于或等于0,商品ID是:
%s
"
,
callRequest
.
getRequest
().
getAppkey
(),
callRequest
.
getBizModel
().
getPlatProductID
()));
log
.
error
(
String
.
format
(
"菠萝派商城appkey[%s]更新库存失败,库存必须大于或等于0,商品ID是:
[%s]
"
,
callRequest
.
getRequest
().
getAppkey
(),
callRequest
.
getBizModel
().
getPlatProductID
()));
throw
new
BizException
(
String
.
format
(
"菠萝派商城appkey[%s]更新库存失败,库存必须大于或等于0,商品ID是:
[%s]
"
,
callRequest
.
getRequest
().
getAppkey
(),
callRequest
.
getBizModel
().
getPlatProductID
()));
}
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"s
uppli
erId"
,
callRequest
.
getSupplier
().
getId
());
params
.
put
(
"s
ell
erId"
,
callRequest
.
getSupplier
().
getId
());
params
.
put
(
"productId"
,
callRequest
.
getBizModel
().
getPlatProductID
());
params
.
put
(
"skuId"
,
callRequest
.
getBizModel
().
getSkuID
());
params
.
put
(
"stock"
,
callRequest
.
getBizModel
().
getQuantity
());
List
<
DownloadProductBean
>
downloadProductBeans
=
pineappleDao
.
downloadProductList
ByMap
(
params
);
DownloadProductBean
downloadProductBeans
=
pineappleDao
.
getDownloadProductBean
ByMap
(
params
);
if
(
StringUtil
.
isNull
(
downloadProductBeans
)){
log
.
error
(
String
.
format
(
"菠萝派商城appkey[%s],没有该商品[%s]"
,
callRequest
.
getRequest
().
getAppkey
(),
callRequest
.
getBizModel
().
getPlatProductID
()));
throw
new
BizException
(
String
.
format
(
"菠萝派商城appkey[%s,没有该商品[%s]"
,
callRequest
.
getRequest
().
getAppkey
(),
callRequest
.
getBizModel
().
getPlatProductID
()));
throw
new
BizException
(
String
.
format
(
"菠萝派商城appkey[%s
]
,没有该商品[%s]"
,
callRequest
.
getRequest
().
getAppkey
(),
callRequest
.
getBizModel
().
getPlatProductID
()));
}
if
(
pineappleDao
.
updateSkuStock
(
params
)
!=
1
){
log
.
error
(
String
.
format
(
"菠萝派商城appkey[%s]更新
库存失败,没有该商品
[%s]"
,
callRequest
.
getRequest
().
getAppkey
(),
callRequest
.
getBizModel
().
getPlatProductID
()));
throw
new
BizException
(
String
.
format
(
"菠萝派商城appkey[%s]更新
库存失败,没有该商品
[%s]"
,
callRequest
.
getRequest
().
getAppkey
(),
callRequest
.
getBizModel
().
getPlatProductID
()));
log
.
error
(
String
.
format
(
"菠萝派商城appkey[%s]更新
sku库存失败,没有该sku
[%s]"
,
callRequest
.
getRequest
().
getAppkey
(),
callRequest
.
getBizModel
().
getPlatProductID
()));
throw
new
BizException
(
String
.
format
(
"菠萝派商城appkey[%s]更新
sku库存失败,没有该sku
[%s]"
,
callRequest
.
getRequest
().
getAppkey
(),
callRequest
.
getBizModel
().
getPlatProductID
()));
}
List
<
DownloadProductSkuBean
>
skuBean
=
pineappleDao
.
downloadSkuByProductId
(
callRequest
.
getBizModel
().
getPlatProductID
());
if
(
StringUtil
.
isNull
(
skuBean
)){
log
.
error
(
String
.
format
(
"菠萝派商城appkey[%s]更新库存失败,查询不到该
SKU
[%s]"
,
callRequest
.
getRequest
().
getAppkey
(),
callRequest
.
getBizModel
().
getPlatProductID
()));
throw
new
BizException
(
String
.
format
(
"菠萝派商城appkey[%s]更新库存失败,查询不到该
SKU
[%s]"
,
callRequest
.
getRequest
().
getAppkey
(),
callRequest
.
getBizModel
().
getPlatProductID
()));
log
.
error
(
String
.
format
(
"菠萝派商城appkey[%s]更新库存失败,查询不到该
商品所有的sku
[%s]"
,
callRequest
.
getRequest
().
getAppkey
(),
callRequest
.
getBizModel
().
getPlatProductID
()));
throw
new
BizException
(
String
.
format
(
"菠萝派商城appkey[%s]更新库存失败,查询不到该
商品所有的sku
[%s]"
,
callRequest
.
getRequest
().
getAppkey
(),
callRequest
.
getBizModel
().
getPlatProductID
()));
}
//获取sku总库存
Integer
sumStock
=
skuBean
.
stream
().
map
(
s
->
s
.
getSkuQuantity
()).
reduce
(
0
,(
a
,
b
)
->{
...
...
请
注册
或
登录
后发表评论