Commit 1dbaa118 authored by shiyu's avatar shiyu

商品详情

parent 9aa2772c
...@@ -88,14 +88,12 @@ public class SupplierItemServiceImpl implements SupplierItemService { ...@@ -88,14 +88,12 @@ public class SupplierItemServiceImpl implements SupplierItemService {
public Result findDetail(SupplierItemRequestDto dto) { public Result findDetail(SupplierItemRequestDto dto) {
try { try {
String shareRecordId = dto.getShareRecordId(); String shareRecordId = dto.getShareRecordId();
DistributorShareRecord distributorShareRecord = null; DistributorShareRecord distributorShareRecord = new DistributorShareRecord();
long itemId = 0; long itemId = 0;
if (dto.getId() != null) { if (StringUtils.isEmpty(shareRecordId) && dto.getId() == null) {
itemId = dto.getId();
}
else if (StringUtils.isEmpty(shareRecordId) && dto.getId() == null) {
return Result.failed("商品信息为空"); return Result.failed("商品信息为空");
} else { } else if (StringUtils.hasLength(shareRecordId)) {
if (!shareRecordId.contains(SYSTEM_ACCOUNT.toString())) {
distributorShareRecord = distributorShareRecordDao.findById(shareRecordId); distributorShareRecord = distributorShareRecordDao.findById(shareRecordId);
if (distributorShareRecord == null || !distributorShareRecord.getEnabled()) { if (distributorShareRecord == null || !distributorShareRecord.getEnabled()) {
return Result.failed("该商品已下架"); return Result.failed("该商品已下架");
...@@ -103,6 +101,9 @@ public class SupplierItemServiceImpl implements SupplierItemService { ...@@ -103,6 +101,9 @@ public class SupplierItemServiceImpl implements SupplierItemService {
itemId = distributorShareRecord.getItemId(); itemId = distributorShareRecord.getItemId();
} }
} }
} else {
itemId = dto.getId();
}
SupplierItemVo supplierItemVo = new SupplierItemVo(); SupplierItemVo supplierItemVo = new SupplierItemVo();
//用户点击链接进入详情页需要记录 //用户点击链接进入详情页需要记录
if (!dto.getIsShop()) { if (!dto.getIsShop()) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment