Commit 1dbaa118 authored by shiyu's avatar shiyu

商品详情

parent 9aa2772c
......@@ -88,20 +88,21 @@ public class SupplierItemServiceImpl implements SupplierItemService {
public Result findDetail(SupplierItemRequestDto dto) {
try {
String shareRecordId = dto.getShareRecordId();
DistributorShareRecord distributorShareRecord = null;
DistributorShareRecord distributorShareRecord = new DistributorShareRecord();
long itemId = 0;
if (dto.getId() != null) {
itemId = dto.getId();
}
else if (StringUtils.isEmpty(shareRecordId) && dto.getId() == null) {
if (StringUtils.isEmpty(shareRecordId) && dto.getId() == null) {
return Result.failed("商品信息为空");
} else {
distributorShareRecord = distributorShareRecordDao.findById(shareRecordId);
if (distributorShareRecord == null || !distributorShareRecord.getEnabled()) {
return Result.failed("该商品已下架");
} else {
itemId = distributorShareRecord.getItemId();
} else if (StringUtils.hasLength(shareRecordId)) {
if (!shareRecordId.contains(SYSTEM_ACCOUNT.toString())) {
distributorShareRecord = distributorShareRecordDao.findById(shareRecordId);
if (distributorShareRecord == null || !distributorShareRecord.getEnabled()) {
return Result.failed("该商品已下架");
} else {
itemId = distributorShareRecord.getItemId();
}
}
} else {
itemId = dto.getId();
}
SupplierItemVo supplierItemVo = new SupplierItemVo();
//用户点击链接进入详情页需要记录
......
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