fix: anonymize clerk random order views
This commit is contained in:
@@ -44,11 +44,9 @@ import com.starry.admin.modules.order.service.support.ClerkRevenueCalculator;
|
||||
import com.starry.admin.modules.personnel.module.entity.PlayPersonnelGroupInfoEntity;
|
||||
import com.starry.admin.modules.personnel.service.IPlayPersonnelGroupInfoService;
|
||||
import com.starry.admin.modules.shop.module.constant.CouponUseState;
|
||||
import com.starry.admin.modules.shop.module.vo.PlayCouponDetailsReturnVo;
|
||||
import com.starry.admin.modules.shop.service.IPlayCouponDetailsService;
|
||||
import com.starry.admin.modules.weichat.entity.order.*;
|
||||
import com.starry.admin.modules.weichat.service.NotificationSender;
|
||||
import com.starry.admin.modules.withdraw.service.IEarningsService;
|
||||
import com.starry.admin.utils.DateRangeUtils;
|
||||
import com.starry.admin.utils.SecurityUtils;
|
||||
import com.starry.common.utils.ConvertUtil;
|
||||
@@ -478,6 +476,16 @@ public class PlayOrderInfoServiceImpl extends ServiceImpl<PlayOrderInfoMapper, P
|
||||
log.warn("Refund info missing for cancelled order, orderId={}", returnVo.getId());
|
||||
}
|
||||
}
|
||||
|
||||
// Privacy protection: Hide customer info for pending random orders
|
||||
if (OrderConstant.PlaceType.RANDOM.getCode().equals(returnVo.getPlaceType())
|
||||
&& OrderStatus.PENDING.getCode().equals(returnVo.getOrderStatus())) {
|
||||
returnVo.setWeiChatCode("");
|
||||
returnVo.setCustomNickname("匿名用户");
|
||||
returnVo.setCustomAvatar("");
|
||||
returnVo.setCustomId("");
|
||||
}
|
||||
|
||||
if (returnVo.getEstimatedRevenue() == null) {
|
||||
returnVo.setEstimatedRevenue(BigDecimal.ZERO);
|
||||
}
|
||||
@@ -512,8 +520,21 @@ public class PlayOrderInfoServiceImpl extends ServiceImpl<PlayOrderInfoMapper, P
|
||||
.selectAs(PlayCustomLevelInfoEntity::getName, "customLevelName");
|
||||
lambdaQueryWrapper.leftJoin(PlayCustomLevelInfoEntity.class, PlayCustomLevelInfoEntity::getId,
|
||||
PlayCustomUserInfoEntity::getLevelId);
|
||||
return this.baseMapper.selectJoinPage(new Page<>(vo.getPageNum(), vo.getPageSize()),
|
||||
PlayClerkOrderListReturnVo.class, lambdaQueryWrapper);
|
||||
IPage<PlayClerkOrderListReturnVo> page = this.baseMapper.selectJoinPage(
|
||||
new Page<>(vo.getPageNum(), vo.getPageSize()),
|
||||
PlayClerkOrderListReturnVo.class,
|
||||
lambdaQueryWrapper);
|
||||
|
||||
for (PlayClerkOrderListReturnVo record : page.getRecords()) {
|
||||
if (OrderConstant.PlaceType.RANDOM.getCode().equals(record.getPlaceType())
|
||||
&& OrderStatus.PENDING.getCode().equals(record.getOrderStatus())) {
|
||||
record.setCustomNickname("匿名用户");
|
||||
record.setCustomAvatar("");
|
||||
record.setCustomId("");
|
||||
}
|
||||
}
|
||||
|
||||
return page;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user