fix: random order clerk visibility rules
Some checks failed
Build and Push Backend / docker (push) Failing after 12s

This commit is contained in:
irving
2025-12-25 12:58:31 -05:00
parent f300723fc0
commit c29f76c2fc
2 changed files with 117 additions and 3 deletions

View File

@@ -477,13 +477,27 @@ public class PlayOrderInfoServiceImpl extends ServiceImpl<PlayOrderInfoMapper, P
}
}
// Privacy protection: Hide customer info for pending random orders
if (OrderConstant.PlaceType.RANDOM.getCode().equals(returnVo.getPlaceType())
&& OrderStatus.PENDING.getCode().equals(returnVo.getOrderStatus())) {
// Privacy protection for random orders:
// 1) Pending random orders: hide customer info completely.
// 2) Random orders accepted by another clerk: hide customer info and mask status.
boolean isRandomOrder = OrderConstant.PlaceType.RANDOM.getCode().equals(returnVo.getPlaceType());
String orderStatus = returnVo.getOrderStatus();
String acceptBy = returnVo.getAcceptBy();
boolean isPending = OrderStatus.PENDING.getCode().equals(orderStatus);
boolean acceptedByOtherClerk = StringUtils.isNotEmpty(acceptBy) && !acceptBy.equals(clerkId) && !isPending;
if (isRandomOrder && isPending) {
returnVo.setWeiChatCode("");
returnVo.setCustomNickname("匿名用户");
returnVo.setCustomAvatar("");
returnVo.setCustomId("");
} else if (isRandomOrder && acceptedByOtherClerk) {
returnVo.setWeiChatCode("");
returnVo.setCustomNickname("匿名用户");
returnVo.setCustomAvatar("");
returnVo.setCustomId("");
// Hide concrete status when viewing another clerk's random order
returnVo.setOrderStatus("");
}
if (returnVo.getEstimatedRevenue() == null) {