小程序分销记录shopId可为空

This commit is contained in:
张松 2025-10-30 11:43:16 +08:00
parent 8bd9b29b7a
commit d96e4f304d
1 changed files with 6 additions and 3 deletions

View File

@ -60,14 +60,17 @@ public class MkDistributionFlowServiceImpl extends ServiceImpl<MkDistributionFlo
@Override
public Map<String, Object> distributionFlow(long userId, String startTime, String endTime, Long shopId, String status) {
ShopUser shopUserInfo = shopUserService.getShopUserInfo(shopId, userId);
ShopUser shopUserInfo = null;
if (shopId != null) {
shopUserInfo = shopUserService.getShopUserInfo(shopId, userId);
}
PageHelper.startPage(PageUtil.buildPageHelp());
List<MkDistributionFlowVO> list = mapper.pageInfo(shopId, StrUtil.isBlank(startTime) ? null : DateUtil.parseLocalDateTime(startTime),
StrUtil.isBlank(endTime) ? null : DateUtil.parseLocalDateTime(endTime), status,null, shopUserInfo.getId(), null);
StrUtil.isBlank(endTime) ? null : DateUtil.parseLocalDateTime(endTime), status,null, shopUserInfo == null ? null : shopUserInfo.getId(), null);
Page<MkDistributionFlowVO> page = PageUtil.convert(new PageInfo<>(list));
Map<String, Object> map = BeanUtil.beanToMap(page);
map.put("totalAmount", mapper.totalAmount(shopId, StrUtil.isBlank(startTime) ? null : DateUtil.parseLocalDateTime(startTime),
StrUtil.isBlank(endTime) ? null : DateUtil.parseLocalDateTime(endTime), status,null, shopUserInfo.getId(), null));
StrUtil.isBlank(endTime) ? null : DateUtil.parseLocalDateTime(endTime), status,null, shopUserInfo == null ? null : shopUserInfo.getId(), null));
return map;
}
}