Commit a5cd578e authored by shiyu's avatar shiyu

个人主页商品列表排序

parent f36b7de3
......@@ -20,6 +20,15 @@ public interface SupplierItemDao {
*/
List<SupplierItem> findList(SupplierItemRequestDto supplierItemRequestDto);
/**
* 个人主页查询商品列表
* 特殊排序
* @param supplierItemRequestDto
* @return
*/
List<SupplierItem> findListForSort(SupplierItemRequestDto supplierItemRequestDto);
/**
* 查询用户上传的已经售罄的商品
* @param dto
......
......@@ -48,6 +48,24 @@ public class SupplierItemDaoImpl implements SupplierItemDao {
}
@Override
public List<SupplierItem> findListForSort(SupplierItemRequestDto dto) {
SupplierItemExample supplierItemExample = new SupplierItemExample();
SupplierItemExample.Criteria criteria = supplierItemExample.createCriteria();
JdbcHelper.ifPresent(dto.getCreatorId(), criteria::andCreatorIdEqualTo);
JdbcHelper.ifPresent(dto.getId(), criteria::andIdEqualTo);
JdbcHelper.ifPresent(dto.getIds(), criteria::andIdIn);
if (StringUtils.hasLength(dto.getName())) {
criteria.andNameLike("%" + dto.getName() + "%");
}
JdbcHelper.ifPresent(dto.getType(), criteria::andTypeEqualTo);
JdbcHelper.ifPresent(dto.getStock(), criteria::andStockGreaterThan);
JdbcHelper.ifPresent(dto.getIsOnSale(), criteria::andIsOnSaleEqualTo);
JdbcHelper.ifPresent(dto.getIsDeleted(), criteria::andIsDeletedEqualTo);
supplierItemExample.setOrderByClause(" is_on_sale desc, stock desc, create_time desc");
PageHelper.startPage(dto.getPage(), dto.getLimit());
return supplierItemMapper.selectByExampleWithBLOBs(supplierItemExample);
}
@Override
public List<SupplierItem> findSellOutList(SupplierItemRequestDto dto) {
......
......@@ -42,7 +42,7 @@ public class DeliveryNoticeMsg implements Entity, AbstractSubscribeMsg {
private Date deliveryTime;
/**
* 1商家2用户
* 1商家2用户3藏家
*/
private Integer shopState;
......
......@@ -36,6 +36,16 @@ public class SignedNoticeMsg implements Entity, AbstractSubscribeMsg {
*/
private Date signedTime;
/**
* 跳转地址
*/
private String url;
/**
* 1商家2用户3藏家
*/
private Integer shopState;
@Override
public Map<String, Object> getTempletParam() {
......
......@@ -123,7 +123,6 @@ public class CollectionBookServiceImpl implements CollectionBookService {
//查询藏家白名单, 在白名单中说是藏家,需要加上默认标签
if (dto.getViewLabelType().intValue() == 1) {
if (collectorWhiteListDao.isExisted(userId)) {
if (dto.getViewLabelType().intValue() == 1) {
for (CollectionBookConstants.DefaultBookEnum defaultBookEnum : CollectionBookConstants.DefaultBookEnum.values()) {
Map<String, Object> map = new HashMap<>();
map.put("id", defaultBookEnum.getId());
......@@ -132,7 +131,6 @@ public class CollectionBookServiceImpl implements CollectionBookService {
}
}
}
}
if (dto.getIsHasExtraLabel()) {
Map<String, Object> map = new HashMap<>();
map.put("id", 0);
......
......@@ -130,7 +130,7 @@ public class CollectionItemsRelationServiceImpl implements CollectionItemsRelati
supplierItemRequestDto.setIsDeleted(false);
supplierItemRequestDto.setPage(dto.getPage());
supplierItemRequestDto.setLimit(dto.getLimit());
List<SupplierItem> supplierItemList = supplierItemDao.findList(supplierItemRequestDto);
List<SupplierItem> supplierItemList = supplierItemDao.findListForSort(supplierItemRequestDto);
List<SupplierItemVo> list = new ArrayList<>();
PageInfo<SupplierItem> pageInfo = new PageInfo<>(supplierItemList);
supplierItemList.forEach(supplierItem -> {
......
......@@ -395,7 +395,7 @@ public class DistributionOrderServiceImpl implements DistributionOrderService {
if (collectionShareRecord == null || collectionShareRecord.getType() == DistributionEnum.CollectionShareTypeEnum.PAGE.getCode()) {
return Result.failed("该分享链接无效");
}
if (!collectionShareRecord.getIsDeleted()) {
if (collectionShareRecord.getIsDeleted()) {
return Result.failed("该分享链接已失效");
}
itemId = collectionShareRecord.getShareTargetId();
......@@ -659,6 +659,11 @@ public class DistributionOrderServiceImpl implements DistributionOrderService {
//发送给卖家
String sellerOpenId = sendMsgService.getOpenIdByUserId(distributionOrder.getSellerId());
if (com.xxdxxs.utils.StringUtils.hasLength(sellerOpenId)) {
if (distributionOrder.getType().intValue() == DistributionEnum.DistributionTypeEnum.COLLECT.getCode()) {
signedNoticeMsg.setShopState(2);
} else {
signedNoticeMsg.setShopState(1);
}
sendMsgService.sendSignedTempletMsg(sellerOpenId, signedNoticeMsg);
} else {
logger.info(">>>>> 分销商id :{}, 获取openid失败,无法发送模板信息 <<<<<", distributionOrder.getSellerId());
......
......@@ -142,7 +142,7 @@ public class SendMsgServiceImpl implements SendMsgService {
miniprogramMap.put("appid", APPLET_APPID);
StringBuffer stringBuffer = new StringBuffer(DISTRIBUTION_MSG_URL);
stringBuffer.append("?orderId=" + signedNoticeMsg.getDistributionOrderId());
stringBuffer.append("&shopState=1");
stringBuffer.append("&shopState=" + signedNoticeMsg.getShopState());
miniprogramMap.put("pagepath", stringBuffer.toString());
map.put("miniprogram", miniprogramMap);
map.put("data", signedNoticeMsg.getTempletParam());
......
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