Toggle navigation
Toggle navigation
This project
Loading...
Sign in
ufo
/
yohoufo-fore
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
chenchao
6 years ago
Commit
815c7573fcf3ba0eb0cf1b43e1a475146938cbb1
1 parent
64d48985
fix bug 5091
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
33 additions
and
6 deletions
dal/src/main/java/com/yohoufo/dal/order/SellerOrderGoodsMapper.java
dal/src/main/resources/META-INF/mybatis/order/SellerOrderGoodsMapper.xml
order/src/main/java/com/yohoufo/order/model/dto/ChangePricePrepareDTO.java
order/src/main/java/com/yohoufo/order/service/impl/SellerOrderService.java
order/src/main/java/com/yohoufo/order/service/impl/processor/ChangePricePrepareProcessor.java
dal/src/main/java/com/yohoufo/dal/order/SellerOrderGoodsMapper.java
View file @
815c757
...
...
@@ -72,4 +72,8 @@ public interface SellerOrderGoodsMapper {
@Param
(
"statusList"
)
List
<
Integer
>
statusList
,
@Param
(
"id"
)
Integer
id
,
@Param
(
"limit"
)
Integer
limit
);
List
<
SellerOrderGoods
>
selectByUidStorageStatusGBBPSList
(
@Param
(
"uid"
)
int
uid
,
@Param
(
"storageId"
)
Integer
storageId
,
@Param
(
"statusList"
)
List
<
Integer
>
statusList
);
}
\ No newline at end of file
...
...
dal/src/main/resources/META-INF/mybatis/order/SellerOrderGoodsMapper.xml
View file @
815c757
...
...
@@ -387,4 +387,10 @@
order by id desc
limit #{limit, jdbcType=INTEGER}
</select>
<select
id=
"selectByUidStorageStatusGBBPSList"
resultMap=
"BaseResultMap"
>
select
<include
refid=
"Base_Column_List"
/>
from seller_order_goods
where storage_id = #{storageId,jdbcType=INTEGER},
and
<include
refid=
"sql_where_4_select_UidStatusGBBNList"
/>
</select>
</mapper>
\ No newline at end of file
...
...
order/src/main/java/com/yohoufo/order/model/dto/ChangePricePrepareDTO.java
View file @
815c757
package
com
.
yohoufo
.
order
.
model
.
dto
;
import
com.yohoufo.dal.order.model.SellerOrderGoods
;
import
com.yohoufo.order.service.proxy.ProductProxyService
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
...
...
@@ -18,6 +19,11 @@ import java.util.Map;
@AllArgsConstructor
@NoArgsConstructor
public
class
ChangePricePrepareDTO
{
/**
* 这是一个商品的基本数据,也算是样例,不需要care它的id
* 使用场景:调价后清理storage-id 维度的缓存,卖家订单(商品)详情的缓存是根据group(bn+status+price)
*/
private
SellerOrderGoods
baseSellerOrderGoods
;
ProductProxyService
.
PrdPrice
prdPrice
;
...
...
order/src/main/java/com/yohoufo/order/service/impl/SellerOrderService.java
View file @
815c757
...
...
@@ -617,7 +617,8 @@ public class SellerOrderService implements IOrderListService, IOrderDetailServi
merchantOrderPaymentService
.
changePriceAddWalletDetail
(
sellerWallet
,
orderList
);
}
successCnt
=
skupMap
.
size
();
List
<
RedisKeyBuilder
>
skupDetailRKBs
=
getSkupDetailRKBs
(
skupMap
);
SellerOrderGoods
sampleSog
=
cppDto
.
getBaseSellerOrderGoods
();
List
<
RedisKeyBuilder
>
skupDetailRKBs
=
getSkupDetailRKBs
(
sampleSog
);
skupDetailRKBs
.
add
(
CacheKeyBuilder
.
orderListKey
(
req
.
getUid
(),
TabType
.
SELL
.
getValue
()));
cacheCleaner
.
delete
(
skupDetailRKBs
);
}
else
{
...
...
@@ -633,18 +634,27 @@ public class SellerOrderService implements IOrderListService, IOrderDetailServi
return
resp
;
}
private
List
<
RedisKeyBuilder
>
getSkupDetailRKBs
(
Map
<
Integer
,
SkupDto
>
skupMap
){
Set
<
String
>
keys
=
new
HashSet
<>(
skupMap
.
size
());
List
<
RedisKeyBuilder
>
skupDetailRKBs
=
new
ArrayList
<>(
skupMap
.
size
());
for
(
Map
.
Entry
<
Integer
,
SkupDto
>
entry
:
skupMap
.
entrySet
()){
SellerOrderGoods
sog
=
entry
.
getValue
().
getSellerOrderGoods
();
private
List
<
RedisKeyBuilder
>
getSkupDetailRKBs
(
SellerOrderGoods
sampleSog
){
List
<
Integer
>
statusList
=
Arrays
.
asList
(
SkupStatus
.
CAN_SELL
.
getCode
());
List
<
SellerOrderGoods
>
sellerOrderGoodsList
=
sellerOrderGoodsMapper
.
selectByUidStorageStatusGBBPSList
(
sampleSog
.
getUid
(),
sampleSog
.
getStorageId
(),
statusList
);
List
<
RedisKeyBuilder
>
skupDetailRKBs
=
new
ArrayList
<>(
sellerOrderGoodsList
.
size
());
if
(
CollectionUtils
.
isEmpty
(
sellerOrderGoodsList
)){
return
skupDetailRKBs
;
}
Set
<
String
>
keys
=
new
HashSet
<>(
sellerOrderGoodsList
.
size
());
for
(
SellerOrderGoods
sog
:
sellerOrderGoodsList
){
String
key
=
new
StringBuilder
().
append
(
sog
.
getBatchNo
()).
append
(
sog
.
getGoodsPrice
())
.
append
(
sog
.
getStatus
()).
toString
();
if
(
keys
.
contains
(
key
)){
continue
;
}
skupDetailRKBs
.
add
(
CacheKeyBuilder
.
sellerOrderDetailKey
(
sog
));
}
log
.
info
(
"build detail cache group keys {}"
,
keys
);
return
skupDetailRKBs
;
}
...
...
order/src/main/java/com/yohoufo/order/service/impl/processor/ChangePricePrepareProcessor.java
View file @
815c757
...
...
@@ -128,6 +128,7 @@ public class ChangePricePrepareProcessor {
sellerOrderPrepareProcessor
.
checkIncome
(
storageId
,
computeResult
.
getIncome
());
return
ChangePricePrepareDTO
.
builder
()
.
baseSellerOrderGoods
(
sampleSog
)
.
prdPrice
(
prdPrice
)
.
salePrice
(
salePrice
)
.
diffEarnestMoney
(
diffEarnestMoney
)
...
...
Please
register
or
login
to post a comment