lb用户同步的代码结构
This commit is contained in:
@@ -48,7 +48,7 @@ public class LbOrderRowServiceImpl extends ServiceImpl<LbOrderRowMapper, LbOrder
|
||||
private static final int DINGTALK_SELLER_CONFIRM_BATCH_SIZE = 15;
|
||||
|
||||
private static final String DINGTALK_SELLER_CONFIRM_PREFIX =
|
||||
"买家已支付,不要影响 对方寄卖, 请如下卖家确认:";
|
||||
"提醒,请如下卖家确认,不要耽误 买方寄卖";
|
||||
|
||||
private static final long SUM_PLACEHOLDER_USER_ID = 10000L;
|
||||
|
||||
@@ -458,16 +458,18 @@ public class LbOrderRowServiceImpl extends ServiceImpl<LbOrderRowMapper, LbOrder
|
||||
return result;
|
||||
}
|
||||
|
||||
List<String> sellerNames =
|
||||
details.stream()
|
||||
.map(this::resolveSellerDisplayName)
|
||||
.distinct()
|
||||
.limit(DINGTALK_SELLER_CONFIRM_BATCH_SIZE)
|
||||
.collect(Collectors.toList());
|
||||
|
||||
int messageCount = 0;
|
||||
for (int i = 0; i < details.size(); i += DINGTALK_SELLER_CONFIRM_BATCH_SIZE) {
|
||||
int end = Math.min(i + DINGTALK_SELLER_CONFIRM_BATCH_SIZE, details.size());
|
||||
List<LbOrderRow> batch = details.subList(i, end);
|
||||
String sellerNames =
|
||||
batch.stream()
|
||||
.map(this::resolveSellerDisplayName)
|
||||
.collect(Collectors.joining(","));
|
||||
dingTalkRobotService.sendText(DINGTALK_SELLER_CONFIRM_PREFIX + sellerNames);
|
||||
messageCount++;
|
||||
if (!sellerNames.isEmpty()) {
|
||||
dingTalkRobotService.sendText(
|
||||
DINGTALK_SELLER_CONFIRM_PREFIX + String.join(",", sellerNames));
|
||||
messageCount = 1;
|
||||
}
|
||||
|
||||
result.put("success", true);
|
||||
|
||||
Reference in New Issue
Block a user