|
|
@@ -302,7 +302,12 @@ public class GoodsDonController {
|
|
|
* 获取商品详情
|
|
|
*/
|
|
|
@GetMapping("/get/{id}")
|
|
|
- public Result<GoodsDonViews> getDetail(@PathVariable Long id) {
|
|
|
+ public Result<GoodsDonViews> getDetail(@PathVariable Long id, Boolean isLogin) {
|
|
|
+ Long userId = null;
|
|
|
+ if (isLogin != null && isLogin) {
|
|
|
+ userId = StpUserUtil.getLoginIdAsLong();
|
|
|
+ }
|
|
|
+ final Long fUid = userId;
|
|
|
GoodsDonViews views = beanSearcher.searchFirst(GoodsDonViews.class, MapUtils.builder().field(GoodsDonViews::getId, id).build());
|
|
|
|
|
|
views.setSpecs(beanSearcher.searchFirst(GoodsDonSpecFrontView.class, MapUtils.builder().field(GoodsDonSpecFrontView::getGoodsId, views.getId()).build()));
|
|
|
@@ -318,6 +323,13 @@ public class GoodsDonController {
|
|
|
.field(GoodsDiscountPlusPurchaseRelationFrontView::getSkuId, sku.getId())
|
|
|
.build()));
|
|
|
}
|
|
|
+ if (fUid != null && views.getIsSp()) {
|
|
|
+ //设置特定价格
|
|
|
+ if (!isPaySpecificGoodsIds(sku.getSpecificGoodsIds(), fUid)) {
|
|
|
+ sku.setSpecificGoodsIds(null);
|
|
|
+ sku.setSpecificPrice(null);
|
|
|
+ }
|
|
|
+ }
|
|
|
});
|
|
|
return GatewayResponse.SUCCESS.newBuilder().toResult(views);
|
|
|
}
|