Commit eb27168b authored by shiyu's avatar shiyu

缺失字段补充

parent 25944b8d
...@@ -40,6 +40,11 @@ public interface CommConsts { ...@@ -40,6 +40,11 @@ public interface CommConsts {
public static final Long SYSTEM_ACCOUNT = 8888888888L; public static final Long SYSTEM_ACCOUNT = 8888888888L;
/**
* 系统默认用户头像URL
*/
public static final String DEFAULT_AVATAR_URL = "https://cdn.wanwudezhi.com/mall-portal/image/4337400862";
} }
...@@ -220,4 +220,14 @@ public class SupplierItemVo implements Entity { ...@@ -220,4 +220,14 @@ public class SupplierItemVo implements Entity {
* 收藏人头像 * 收藏人头像
*/ */
private List<String> collectorsAvatar; private List<String> collectorsAvatar;
/**
* 当前用户是否已收藏
*/
private Boolean isCollected;
/**
* 当前用户是否已分享过
*/
private Boolean isShared;
} }
...@@ -68,4 +68,5 @@ public interface DistributorShareRecordDao { ...@@ -68,4 +68,5 @@ public interface DistributorShareRecordDao {
*/ */
DistributorShareRecord findItemShareRecordByDistributorId(long distributorId, long itemId); DistributorShareRecord findItemShareRecordByDistributorId(long distributorId, long itemId);
} }
...@@ -37,6 +37,7 @@ public class DistributorShareRecordDaoImpl implements DistributorShareRecordDao ...@@ -37,6 +37,7 @@ public class DistributorShareRecordDaoImpl implements DistributorShareRecordDao
DistributorShareRecordExample.Criteria criteria = example.createCriteria(); DistributorShareRecordExample.Criteria criteria = example.createCriteria();
JdbcHelper.ifPresent(dto.getDistributorIdList(), criteria::andDistributorIdIn); JdbcHelper.ifPresent(dto.getDistributorIdList(), criteria::andDistributorIdIn);
JdbcHelper.ifPresent(dto.getItemIdList(), criteria::andItemIdIn); JdbcHelper.ifPresent(dto.getItemIdList(), criteria::andItemIdIn);
JdbcHelper.ifPresent(dto.getType(), criteria::andTypeEqualTo);
criteria.andEnabledEqualTo(true); criteria.andEnabledEqualTo(true);
return distributorShareRecordMapper.selectByExample(example); return distributorShareRecordMapper.selectByExample(example);
} }
......
...@@ -86,12 +86,17 @@ public class SupplierItemDaoImpl implements SupplierItemDao { ...@@ -86,12 +86,17 @@ public class SupplierItemDaoImpl implements SupplierItemDao {
public List<SupplierItem> findForHomePage(SupplierItemRequestDto dto) { public List<SupplierItem> findForHomePage(SupplierItemRequestDto dto) {
SupplierItemExample supplierItemExample = new SupplierItemExample(); SupplierItemExample supplierItemExample = new SupplierItemExample();
SupplierItemExample.Criteria criteria = supplierItemExample.createCriteria(); SupplierItemExample.Criteria criteria = supplierItemExample.createCriteria();
JdbcHelper.ifPresent(dto.getId(), criteria::andIdEqualTo); criteria.andCreatorIdIn(dto.getCreatorIdList());
JdbcHelper.ifPresent(dto.getIds(), criteria::andIdIn); criteria.andTypeIn(dto.getTypeList());
JdbcHelper.ifPresent(dto.getType(), criteria::andTypeEqualTo); criteria.andStockGreaterThan(0);
JdbcHelper.ifPresent(dto.getStock(), criteria::andStockGreaterThan); criteria.andIsDeletedEqualTo(false);
JdbcHelper.ifPresent(dto.getIsOnSale(), criteria::andIsOnSaleEqualTo); criteria.andIsOnSaleEqualTo(true);
JdbcHelper.ifPresent(dto.getIsDeleted(), criteria::andIsDeletedEqualTo); SupplierItemExample.Criteria orCriteria = supplierItemExample.or();
orCriteria.andIdIn(dto.getIds());
orCriteria.andTypeIn(dto.getTypeList());
orCriteria.andStockGreaterThan(0);
orCriteria.andIsDeletedEqualTo(false);
orCriteria.andIsOnSaleEqualTo(true);
supplierItemExample.setOrderByClause(" update_time desc"); supplierItemExample.setOrderByClause(" update_time desc");
PageHelper.startPage(dto.getPage(), dto.getLimit()); PageHelper.startPage(dto.getPage(), dto.getLimit());
return supplierItemMapper.selectByExampleWithBLOBs(supplierItemExample); return supplierItemMapper.selectByExampleWithBLOBs(supplierItemExample);
......
...@@ -38,6 +38,10 @@ public class OfficialAccountCallbackController { ...@@ -38,6 +38,10 @@ public class OfficialAccountCallbackController {
private final static String UNSUBSCRIBE_EVENT = "unsubscribe"; private final static String UNSUBSCRIBE_EVENT = "unsubscribe";
//一次性订阅消息
private final static String SUBSCRIBE_MSG_POPUP_EVENT = "subscribe_msg_popup_event";
@Value("${dts.wx.officialaccount-token}") @Value("${dts.wx.officialaccount-token}")
private String OFFICIALACCOUNTTOKEN; private String OFFICIALACCOUNTTOKEN;
...@@ -122,7 +126,12 @@ public class OfficialAccountCallbackController { ...@@ -122,7 +126,12 @@ public class OfficialAccountCallbackController {
officialAccountSubscribeRecord.setPlatformType(OfficalAccountEnum.PlatformTypeEnum.WECHAT.getCode()); officialAccountSubscribeRecord.setPlatformType(OfficalAccountEnum.PlatformTypeEnum.WECHAT.getCode());
officialAccountSubscribeRecordService.insert(officialAccountSubscribeRecord); officialAccountSubscribeRecordService.insert(officialAccountSubscribeRecord);
} }
logger.info("=============== 更新订阅记录成功 =============="); logger.info("=============== 更新订阅公众号记录成功 ==============");
} else if (SUBSCRIBE_MSG_POPUP_EVENT.equals(event)) {
//一次性订阅消息
} }
} catch (Exception e) { } catch (Exception e) {
logger.error("微信公众号通知回调接口 error : {}", e); logger.error("微信公众号通知回调接口 error : {}", e);
......
...@@ -87,6 +87,6 @@ public interface SupplierItemService { ...@@ -87,6 +87,6 @@ public interface SupplierItemService {
* @param dto * @param dto
* @return * @return
*/ */
Result homePage(SupplierItemRequestDto dto); Result findHomePage(SupplierItemRequestDto dto);
} }
...@@ -131,4 +131,14 @@ public class SupplierItemController { ...@@ -131,4 +131,14 @@ public class SupplierItemController {
return supplierItemService.delete(dto); return supplierItemService.delete(dto);
} }
@ApiOperation(value = "查询主页列表")
@PostMapping("/findHomePage")
public Result findHomePage(@RequestBody SupplierItemRequestDto dto) {
logger.info("删除用户查询主页列表藏品,请求参数:{}", JSON.toJSONString(dto));
if (dto.getId() == null) {
return Result.failed(ResultCode.PARAM_ERROR);
}
return supplierItemService.findHomePage(dto);
}
} }
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