Commit c5bd4f2b authored by shiyu's avatar shiyu

个人藏馆2

parent c8785638
......@@ -33,6 +33,7 @@ public class SysSupplierItemController {
logger.info("新增商品,请求参数:{}", JSON.toJSONString(dto));
Validator validator = new Validator(FormHandler.ofEntity(dto));
validator.set("name", "商品名称").must().string()
.set("images", "图片").must().string()
.set("type", "商品类型").must().number()
.set("buyLimitNum", "限购数量").must().number()
.end();
......
......@@ -188,7 +188,7 @@ public class SupplierItemServiceImpl implements SupplierItemService {
SupplierItem supplierItem = supplierItemDao.findById(itemId);
SupplierItemVo supplierItemVo = new SupplierItemVo();
if (StringUtils.hasLength(shareRecordId)) {
if (distributorShareRecord.getDistributorId() != dto.getUserId()) {
if (distributorShareRecord.getDistributorId().longValue() != dto.getUserId().longValue()) {
//做浏览记录
boolean flag = userRecentBrowseDao.isExisted(dto.getUserId(), distributorShareRecord.getDistributorId());
if (!flag) {
......@@ -407,7 +407,7 @@ public class SupplierItemServiceImpl implements SupplierItemService {
itemId = dto.getId();
}
if (StringUtils.hasLength(shareRecordId)) {
if (distributorShareRecord.getDistributorId() != dto.getUserId()) {
if (distributorShareRecord.getDistributorId().longValue() != dto.getUserId().longValue()) {
//做浏览记录
boolean flag = userRecentBrowseDao.isExisted(dto.getUserId(), distributorShareRecord.getDistributorId());
if (!flag) {
......@@ -635,8 +635,6 @@ public class SupplierItemServiceImpl implements SupplierItemService {
collectionShareRecord = collectionShareRecordDao.findById(dto.getShareRecordId());
itemId = collectionShareRecord.getShareTargetId();
}
supplierItemVo.setIsCollected(true);
SupplierItem supplierItem = supplierItemDao.findById(itemId);
if (supplierItem.getCreatorId().longValue() != userId) {
......@@ -656,7 +654,7 @@ public class SupplierItemServiceImpl implements SupplierItemService {
}
//如果是客态,需要记录浏览记录
if (StringUtils.hasLength(dto.getShareRecordId())) {
if (collectionShareRecord.getItemUserId().longValue() != dto.getUserId()) {
if (collectionShareRecord.getItemUserId().longValue() != dto.getUserId().longValue()) {
boolean isExisted = userRecentBrowseDao.isExistedBySharedUserId(userId, collectionShareRecord.getItemUserId());
if (!isExisted) {
UserRecentBrowse userRecentBrowse = new UserRecentBrowse();
......
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