Commit c5bd4f2b authored by shiyu's avatar shiyu

个人藏馆2

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