替换全部飞书通知发送方法为通过事件中心发送

This commit is contained in:
feng.li
2023-10-24 16:45:38 +08:00
parent 5311eb94d2
commit d2a6b81fa8
14 changed files with 113 additions and 42 deletions

View File

@@ -268,7 +268,7 @@ public class DeskController {
@PostMapping(path = "/updatePartnerIntentInfo")
@ApiOperation("修改加盟商意向信息/行业认知")
public ResponseResult<Integer> updatePartnerIntentInfo(@RequestBody PartnerIntentInfoRequest partnerIntentInfoRequest){
public ResponseResult<Integer> updatePartnerIntentInfo(@RequestBody PartnerIntentInfoRequest partnerIntentInfoRequest) throws ApiException {
return ResponseResult.success(hyPartnerIntentInfoService.submitPartnerIntentInfo(partnerIntentInfoRequest));
}

View File

@@ -1,6 +1,7 @@
package com.cool.store.controller;
import com.cool.store.context.CurrentUserHolder;
import com.cool.store.exception.ApiException;
import com.cool.store.request.follow.AddFollowLogRequest;
import com.cool.store.request.follow.AddFollowTaskRequest;
import com.cool.store.request.follow.FollowTaskIdRequest;
@@ -54,13 +55,13 @@ public class FollowTaskController {
@ApiOperation("新增跟进任务")
@PostMapping("/follow/task/add")
public ResponseResult<Long> addFollowTask(@RequestBody @Validated AddFollowTaskRequest request){
public ResponseResult<Long> addFollowTask(@RequestBody @Validated AddFollowTaskRequest request) throws ApiException {
return ResponseResult.success(followTaskService.addFollowTask(request, CurrentUserHolder.getUser()));
}
@ApiOperation("编辑跟进任务")
@PostMapping("/follow/task/update")
public ResponseResult<Integer> updateFollowTask(@RequestBody @Validated UpdateFollowTaskRequest request){
public ResponseResult<Integer> updateFollowTask(@RequestBody @Validated UpdateFollowTaskRequest request) throws ApiException {
return ResponseResult.success(followTaskService.updateFollowTask(request, CurrentUserHolder.getUserId()));
}

View File

@@ -274,13 +274,13 @@ public class TestController {
}
@GetMapping("/followTaskDailyRemind")
public ResponseResult followTaskDailyRemind() {
public ResponseResult followTaskDailyRemind() throws ApiException {
followTaskService.followTaskDailyRemind();
return ResponseResult.success();
}
@GetMapping("/followTaskAnHourAgoRemind")
public ResponseResult followTaskAnHourAgoRemind() {
public ResponseResult followTaskAnHourAgoRemind() throws ApiException {
followTaskService.followTaskAnHourAgoRemind();
return ResponseResult.success();
}

View File

@@ -1,6 +1,8 @@
package com.cool.store.service;
import cn.hutool.core.util.RandomUtil;
import com.cool.store.enums.FeiShuNoticeMsgEnum;
import com.cool.store.enums.SMSMsgEnum;
import com.cool.store.exception.ApiException;
import com.cool.store.http.EventCenterHttpRequest;
import org.junit.Test;
@@ -28,8 +30,58 @@ public class EventRequestTest extends AbstractJUnit4SpringContextTests {
@Test
public void testSendFeiShuNotice() throws ApiException {
//招商企业
//eventCenterHttpRequest.sendFeiShuNotice(FeiShuNoticeMsgEnum.common_notice, Arrays.asList("9818f98c"), "测试");
//任务中枢企业
eventCenterHttpRequest.sendFeiShuNotice(FeiShuNoticeMsgEnum.ALLOCATION_INVESTMENT_MANAGER, Arrays.asList("661c6cfg"), "2023-10-24 10:09:04", "测试", "1008611");
}
@Test
public void testFeishuNotice() throws ApiException {
//1. 工作台通知
eventCenterHttpRequest.sendFeiShuNotice(FeiShuNoticeMsgEnum.common_notice, Arrays.asList("9818f98c"), "测试");
//2. 分配招商经理
eventCenterHttpRequest.sendFeiShuNotice(FeiShuNoticeMsgEnum.ALLOCATION_INVESTMENT_MANAGER, Arrays.asList("9818f98c"), "2011-11-11 11:11:11", "测试", "1008611");
//3. 转让招商经理
eventCenterHttpRequest.sendFeiShuNotice(FeiShuNoticeMsgEnum.TRANS_INVESTMENT_MANAGER, Arrays.asList("9818f98c"), "2011-11-11 11:11:11", "测试", "1008611");
//4. 收到新线索
eventCenterHttpRequest.sendFeiShuNotice(FeiShuNoticeMsgEnum.BATCH_TRANS_INVESTMENT_MANAGER, Arrays.asList("9818f98c"), "1", "2023-10-24 16:40:07");
//5. 加盟意向申请
eventCenterHttpRequest.sendFeiShuNotice(FeiShuNoticeMsgEnum.INTENTION_APPLY, Arrays.asList("9818f98c"), "测试", "1008611", "2023-10-24 16:40:07");
//6. 线索跟进任务
eventCenterHttpRequest.sendFeiShuNotice(FeiShuNoticeMsgEnum.FOLLOW_TASK, Arrays.asList("9818f98c"), "测试线索跟进任务");
//7. 面试预约申请
eventCenterHttpRequest.sendFeiShuNotice(FeiShuNoticeMsgEnum.INTERVIEW_APPOINTMENT, Arrays.asList("9818f98c"), "测试", "1008611", "2023-10-24 16:40:07");
}
@Test
public void testSMSNotice() throws ApiException {
String testPhone = "13052570930";
String testDate = "2023-11-05 10:00:00";
String randomStr = RandomUtil.randomString(12);
String testWXUrl = "https://wxaurl.cn/" + randomStr;
//1. 意向申请通过
eventCenterHttpRequest.sendSmsVariable(testPhone, SMSMsgEnum.INTENTION_APPLY_PASS, testDate, testWXUrl);
//2. 预约面试通过通知
randomStr = RandomUtil.randomString(12);
testWXUrl = "https://wxaurl.cn/" + randomStr;
eventCenterHttpRequest.sendSmsVariable(testPhone, SMSMsgEnum.INTERVIEW_APPOINTMENT_PASS, testDate, testWXUrl);
//3. 面试通过通知
randomStr = RandomUtil.randomString(12);
testWXUrl = "https://wxaurl.cn/" + randomStr;
eventCenterHttpRequest.sendSmsVariable(testPhone, SMSMsgEnum.INTERVIEW_PASS, testWXUrl);
//4. 面试开始前一天
randomStr = RandomUtil.randomString(12);
testWXUrl = "https://wxaurl.cn/" + randomStr;
eventCenterHttpRequest.sendSmsVariable(testPhone, SMSMsgEnum.INTERVIEW_PASS, "10", testDate, testWXUrl);
//5. 面试开始前30分钟
randomStr = RandomUtil.randomString(12);
testWXUrl = "https://wxaurl.cn/" + randomStr;
eventCenterHttpRequest.sendSmsVariable(testPhone, SMSMsgEnum.INTERVIEW_PASS, testWXUrl);
//6. 短信邀约
randomStr = RandomUtil.randomString(12);
testWXUrl = "https://wxaurl.cn/" + randomStr;
eventCenterHttpRequest.sendSmsVariable(testPhone, SMSMsgEnum.INTERVIEW_PASS, testWXUrl);
}
}