Commit 130d83b899d996d3d7238706d5e8a6becd908be5
1 parent
92aea48e
update:购物车强制更新
Showing
2 changed files
with
8 additions
and
6 deletions
etrade-order/src/main/java/com/diligrp/etrade/order/service/impl/ShopCartImpl.java
... | ... | @@ -252,8 +252,8 @@ public class ShopCartImpl implements IShopCartService { |
252 | 252 | if(checkflag){ |
253 | 253 | checkMaxProductWeight(shopCartMessageDto,shopCartMessageOld); |
254 | 254 | } |
255 | - //默认为true,每次离开强制更新 | |
256 | - shopCartMessageService.updateByOld(shopCartMessageOld, shopCartDto.getShopCartMessageDto(),true); | |
255 | + //默认为true | |
256 | + shopCartMessageService.updateByOld(shopCartMessageOld, shopCartDto.getShopCartMessageDto(),shopCartDto.getBo()); | |
257 | 257 | } |
258 | 258 | |
259 | 259 | private void checkMaxProductWeight(ShopCartMessageDto shopCartMessageDto, ShopCartMessage shopCartMessageOld) { | ... | ... |
etrade-order/src/main/java/com/diligrp/etrade/order/service/impl/ShopCartMessageServiceImpl.java
... | ... | @@ -141,10 +141,12 @@ public class ShopCartMessageServiceImpl implements IShopCartMessageService { |
141 | 141 | |
142 | 142 | //如果是处理离线缓存数据,bo=true,总重量做覆盖,不是处理离线数据,总重量做增量 |
143 | 143 | if (bo) { |
144 | - //如果缓存时间在更新之前之前,说明缓存数据不是最新数据,则不进行更新操作 | |
145 | - if (!shopCartMessageDto.getCacheTime().isAfter(shopCartMessageOld.getModifiedTime())) { | |
146 | - return; | |
147 | - } | |
144 | + | |
145 | + //如果缓存时间在更新之前之前,说明缓存数据不是最新数据,则不进行更新操作 | |
146 | +// if (!shopCartMessageDto.getCacheTime().isAfter(shopCartMessageOld.getModifiedTime())) { | |
147 | +// return; | |
148 | +// } | |
149 | + //TODO 当前为强制更新 | |
148 | 150 | shopCartMessageDto.setModifiedTime(shopCartMessageDto.getCacheTime()==null?LocalDateTime.now():shopCartMessageDto.getCacheTime()); |
149 | 151 | }else { |
150 | 152 | shopCartMessageDto.setModifiedTime(LocalDateTime.now()); | ... | ... |