fix: random order clerk visibility rules
Some checks failed
Build and Push Backend / docker (push) Failing after 12s
Some checks failed
Build and Push Backend / docker (push) Failing after 12s
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user