|
|
@@ -65,19 +65,18 @@ public class FeishuRobotLinkConfig {
|
|
|
if ("帮助".equals(text)){
|
|
|
consoleHelp(event);
|
|
|
}
|
|
|
- else if (text.contains("同步巨量商品库")) { //异步
|
|
|
- String platformId = text.replace("同步巨量商品库", "").trim();
|
|
|
+ else if (text.contains("初始化巨量商品库")) { //异步
|
|
|
+ String platformId = text.replace("初始化巨量商品库", "").trim();
|
|
|
if (StringUtils.isEmpty(platformId)){
|
|
|
- responseMessage(event, "请写明要同步的商品库ID");
|
|
|
+ responseMessage(event, "请写明要初始化的商品库ID");
|
|
|
}else {
|
|
|
executorService.submit(new Runnable() {
|
|
|
@Override
|
|
|
public void run() {
|
|
|
try {
|
|
|
- responseMessage(event, "商品库同步任务已启动");
|
|
|
+ responseMessage(event, "商品库初始化任务已启动");
|
|
|
String res = feishuDocSyncService.syncBytedanceProductPlatform();
|
|
|
-// feishuDocSyncService.syncBytedanceDysDistributeMovies();
|
|
|
-// bytedanceProductUpdateService.runPlatform(platformId);
|
|
|
+ bytedanceProductUpdateService.initNew();
|
|
|
if (StringUtils.isNotEmpty(res)){
|
|
|
responseMessage(event, res);
|
|
|
}
|
|
|
@@ -91,6 +90,27 @@ public class FeishuRobotLinkConfig {
|
|
|
});
|
|
|
}
|
|
|
|
|
|
+ }else if (text.contains("同步巨量商品库")) { //异步
|
|
|
+ String platformId = text.replace("同步巨量商品库", "").trim();
|
|
|
+ if (StringUtils.isEmpty(platformId)){
|
|
|
+ responseMessage(event, "请写明要同步的商品库ID");
|
|
|
+ }else {
|
|
|
+ executorService.submit(new Runnable() {
|
|
|
+ @Override
|
|
|
+ public void run() {
|
|
|
+ try {
|
|
|
+ responseMessage(event, "商品库同步任务已启动");
|
|
|
+ bytedanceProductUpdateService.runPlatform(platformId);
|
|
|
+ responseMessage(event, "商品库同步任务已完成,请登录巨量平台确认");
|
|
|
+ } catch (IOException e) {
|
|
|
+ throw new RuntimeException(e);
|
|
|
+ }finally {
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
}else {
|
|
|
responseMessage(event, "未识别的指令\n如需帮助,请@机器人并发送[帮助]");
|
|
|
}
|
|
|
@@ -103,7 +123,8 @@ public class FeishuRobotLinkConfig {
|
|
|
String replyContent = "操作指引:\n" +
|
|
|
"同步巨量商品库流程:\n" +
|
|
|
"1. 在https://artlinkworld.feishu.cn/wiki/WxMiwOnEsiNKmWk19yncyrgGnnf?table=tblsf6RT9HAamt8k&view=vew2h7auDC中添加商品库信息\n" +
|
|
|
- "2. 如果需要立刻同步某个商品库,请输入指令(示例ID:1000000001):@机器人 同步巨量商品库1000000001";
|
|
|
+ "2. 如果需要立刻同步某个商品库,请输入指令(示例ID:1000000001):@机器人 同步巨量商品库1000000001" +
|
|
|
+ "\n3. 如果需要初始化某个商品库,请输入指令(示例ID:1000000001):@机器人 初始化巨量商品库1000000001";
|
|
|
// "扫描并同步端分销推广链输入指令:@机器人 同步端分销推广链";
|
|
|
responseMessage(event, replyContent);
|
|
|
}
|