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

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

@@ -36,25 +36,25 @@ public class EventCenterHttpRequest {
/** /**
* 事件中心 url * 事件中心 url
*/ */
@Value("${hsay.event.url}") @Value("${hsay.event.url:null}")
private String eventUrl; private String eventUrl;
/** /**
* pc 端飞书应用地址 * pc 端飞书应用地址
*/ */
@Value("${feishu.notice.link.url}") @Value("${feishu.notice.link.url:null}")
private String PCLinkUrl; private String PCLinkUrl;
/** /**
* 移动端飞书应用地址 * 移动端飞书应用地址
*/ */
@Value("${feishu.notice.link.url.mobile}") @Value("${feishu.notice.link.url.mobile:null}")
private String mobileLinkUrl; private String mobileLinkUrl;
/** /**
* 本系统来源 * 本系统来源
*/ */
@Value("${hsay.event.systemsource}") @Value("${hsay.event.systemsource:null}")
private String source; private String source;
/** /**

View File

@@ -1,6 +1,7 @@
package com.cool.store.service; package com.cool.store.service;
import com.cool.store.context.LoginUserInfo; import com.cool.store.context.LoginUserInfo;
import com.cool.store.exception.ApiException;
import com.cool.store.request.follow.AddFollowLogRequest; import com.cool.store.request.follow.AddFollowLogRequest;
import com.cool.store.request.follow.AddFollowTaskRequest; import com.cool.store.request.follow.AddFollowTaskRequest;
import com.cool.store.request.follow.FollowTaskIdRequest; import com.cool.store.request.follow.FollowTaskIdRequest;
@@ -51,7 +52,7 @@ public interface FollowTaskService {
* @param userInfo * @param userInfo
* @return * @return
*/ */
Long addFollowTask(AddFollowTaskRequest request, LoginUserInfo userInfo); Long addFollowTask(AddFollowTaskRequest request, LoginUserInfo userInfo) throws ApiException;
/** /**
* 编辑跟进任务 * 编辑跟进任务
@@ -59,7 +60,7 @@ public interface FollowTaskService {
* @param userId * @param userId
* @return * @return
*/ */
Integer updateFollowTask(UpdateFollowTaskRequest request, String userId); Integer updateFollowTask(UpdateFollowTaskRequest request, String userId) throws ApiException;
/** /**
* 完成跟进任务 * 完成跟进任务
@@ -81,11 +82,11 @@ public interface FollowTaskService {
* 跟进任务前一小时提醒 * 跟进任务前一小时提醒
* @return * @return
*/ */
void followTaskAnHourAgoRemind(); void followTaskAnHourAgoRemind() throws ApiException;
/** /**
* 跟进任务每日10点提醒 * 跟进任务每日10点提醒
* @return * @return
*/ */
void followTaskDailyRemind(); void followTaskDailyRemind() throws ApiException;
} }

View File

@@ -1,6 +1,7 @@
package com.cool.store.service; package com.cool.store.service;
import com.cool.store.context.LoginUserInfo; import com.cool.store.context.LoginUserInfo;
import com.cool.store.exception.ApiException;
import com.cool.store.request.BaseUserInfoRequest; import com.cool.store.request.BaseUserInfoRequest;
import com.cool.store.request.IndustryCognitionInfoRequest; import com.cool.store.request.IndustryCognitionInfoRequest;
import com.cool.store.request.PartnerIntentInfoRequest; import com.cool.store.request.PartnerIntentInfoRequest;
@@ -45,7 +46,7 @@ public interface HyPartnerIntentInfoService {
*/ */
Boolean updatePartnerIntentInfo(LoginUserInfo userInfo,BaseUserInfoRequest baseUserInfoRequest); Boolean updatePartnerIntentInfo(LoginUserInfo userInfo,BaseUserInfoRequest baseUserInfoRequest);
Integer submitPartnerIntentInfo(PartnerIntentInfoRequest partnerIntentInfoRequest); Integer submitPartnerIntentInfo(PartnerIntentInfoRequest partnerIntentInfoRequest) throws ApiException;
String submitWantShopInfo(PartnerWantShopInfoRequest request); String submitWantShopInfo(PartnerWantShopInfoRequest request);

View File

@@ -159,9 +159,9 @@ public interface HyPartnerLineInfoService {
* @param acceptAdjustType * @param acceptAdjustType
* @return * @return
*/ */
HyPartnerLineInfoDO generateDefaultLineInfo(String partnerId, String wantShopArea, Integer acceptAdjustType,Boolean assignFlag,String investmentManagerId); HyPartnerLineInfoDO generateDefaultLineInfo(String partnerId, String wantShopArea, Integer acceptAdjustType,Boolean assignFlag,String investmentManagerId) throws ApiException;
Long checkGenerateNewLineId(Long lineId); Long checkGenerateNewLineId(Long lineId) throws ApiException;
/** /**
* 编辑加盟商基本信息 * 编辑加盟商基本信息

View File

@@ -1,6 +1,7 @@
package com.cool.store.service; package com.cool.store.service;
import com.cool.store.entity.HyPartnerUserInfoDO; import com.cool.store.entity.HyPartnerUserInfoDO;
import com.cool.store.exception.ApiException;
import com.cool.store.request.PartnerUserInfoRequest; import com.cool.store.request.PartnerUserInfoRequest;
import com.cool.store.vo.ApplyBaseInfoVO; import com.cool.store.vo.ApplyBaseInfoVO;
import com.cool.store.vo.InviteCodeDetailVO; import com.cool.store.vo.InviteCodeDetailVO;
@@ -15,6 +16,6 @@ public interface PartnerUserInfoService {
InviteCodeDetailVO selectInviteCodeDetail(String partnerId); InviteCodeDetailVO selectInviteCodeDetail(String partnerId);
ApplyBaseInfoVO updatePartnerUserInfo(PartnerUserInfoRequest partnerUserInfoRequest); ApplyBaseInfoVO updatePartnerUserInfo(PartnerUserInfoRequest partnerUserInfoRequest) throws ApiException;
} }

View File

@@ -21,6 +21,7 @@ import com.cool.store.entity.HyPartnerTaskInfoLogDO;
import com.cool.store.enums.*; import com.cool.store.enums.*;
import com.cool.store.exception.ApiException; import com.cool.store.exception.ApiException;
import com.cool.store.exception.ServiceException; import com.cool.store.exception.ServiceException;
import com.cool.store.http.EventCenterHttpRequest;
import com.cool.store.http.ISVHttpRequest; import com.cool.store.http.ISVHttpRequest;
import com.cool.store.request.follow.AddFollowLogRequest; import com.cool.store.request.follow.AddFollowLogRequest;
import com.cool.store.request.follow.AddFollowTaskRequest; import com.cool.store.request.follow.AddFollowTaskRequest;
@@ -73,6 +74,8 @@ public class FollowTaskServiceImpl implements FollowTaskService {
private RedisUtilPool redisUtilPool; private RedisUtilPool redisUtilPool;
@Resource @Resource
private NoticeService noticeService; private NoticeService noticeService;
@Resource
private EventCenterHttpRequest eventCenterHttpRequest;
@Value("${feishu.notice.link.url}") @Value("${feishu.notice.link.url}")
private String linkUrl; private String linkUrl;
@@ -128,7 +131,7 @@ public class FollowTaskServiceImpl implements FollowTaskService {
} }
@Override @Override
public Long addFollowTask(AddFollowTaskRequest request, LoginUserInfo userInfo) { public Long addFollowTask(AddFollowTaskRequest request, LoginUserInfo userInfo) throws ApiException {
if(request.getDeadline().getTime() < System.currentTimeMillis()){ if(request.getDeadline().getTime() < System.currentTimeMillis()){
throw new ServiceException(ErrorCodeEnum.DATELINE_BEFORE_NOW); throw new ServiceException(ErrorCodeEnum.DATELINE_BEFORE_NOW);
} }
@@ -147,7 +150,7 @@ public class FollowTaskServiceImpl implements FollowTaskService {
} }
@Override @Override
public Integer updateFollowTask(UpdateFollowTaskRequest request, String userId) { public Integer updateFollowTask(UpdateFollowTaskRequest request, String userId) throws ApiException {
HyFollowTaskDO followTask = hyFollowTaskDAO.getFollowTask(request.getFollowTaskId()); HyFollowTaskDO followTask = hyFollowTaskDAO.getFollowTask(request.getFollowTaskId());
if(FollowTaskStatusEnum.FINISHED.getCode().equals(followTask.getTaskStatus()) || FollowTaskStatusEnum.CANCELLED.getCode().equals(followTask.getTaskStatus())|| FollowTaskStatusEnum.OVERDUE_CANCELLED.getCode().equals(followTask.getTaskStatus())){ if(FollowTaskStatusEnum.FINISHED.getCode().equals(followTask.getTaskStatus()) || FollowTaskStatusEnum.CANCELLED.getCode().equals(followTask.getTaskStatus())|| FollowTaskStatusEnum.OVERDUE_CANCELLED.getCode().equals(followTask.getTaskStatus())){
throw new ServiceException(ErrorCodeEnum.TASK_STATUS_NOT_ALLOW_OPERATE); throw new ServiceException(ErrorCodeEnum.TASK_STATUS_NOT_ALLOW_OPERATE);
@@ -193,7 +196,7 @@ public class FollowTaskServiceImpl implements FollowTaskService {
} }
@Override @Override
public void followTaskAnHourAgoRemind() { public void followTaskAnHourAgoRemind() throws ApiException {
//更新过期的任务状态 //更新过期的任务状态
hyFollowTaskDAO.updateUndoTaskStatusToOverdue(); hyFollowTaskDAO.updateUndoTaskStatusToOverdue();
//获取一个小时后的任务 //获取一个小时后的任务
@@ -225,13 +228,13 @@ public class FollowTaskServiceImpl implements FollowTaskService {
} }
String dateline = DateUtil.format(followTask.getDeadline(), CoolDateUtils.DATE_FORMAT_SEC_7); String dateline = DateUtil.format(followTask.getDeadline(), CoolDateUtils.DATE_FORMAT_SEC_7);
String content = MessageFormat.format(MessageConstants.FOLLOW_TASK_MESSAGE_CONTENT, dateline, partnerInfo.getUsername(), partnerInfo.getMobile()); String content = MessageFormat.format(MessageConstants.FOLLOW_TASK_MESSAGE_CONTENT, dateline, partnerInfo.getUsername(), partnerInfo.getMobile());
noticeService.sendFeiShuNotice(FeiShuNoticeMsgEnum.FOLLOW_TASK, Arrays.asList(followTask.getFollowUserId()), content); eventCenterHttpRequest.sendFeiShuNotice(FeiShuNoticeMsgEnum.FOLLOW_TASK, Arrays.asList(followTask.getFollowUserId()), content);
} }
} }
} }
@Override @Override
public void followTaskDailyRemind() { public void followTaskDailyRemind() throws ApiException {
//获取已逾期的 以及截止时间为当天的任务 的招商经理 //获取已逾期的 以及截止时间为当天的任务 的招商经理
Boolean hasNext = true; Boolean hasNext = true;
int pageNum = CommonConstants.ONE, pageSize = CommonConstants.HUNDRED; int pageNum = CommonConstants.ONE, pageSize = CommonConstants.HUNDRED;
@@ -247,7 +250,7 @@ public class FollowTaskServiceImpl implements FollowTaskService {
pageNum++; pageNum++;
List<FollowTaskNumDTO> followTaskList = hyFollowTaskDAO.getUserTaskNum(remindFollowUserIds, today); List<FollowTaskNumDTO> followTaskList = hyFollowTaskDAO.getUserTaskNum(remindFollowUserIds, today);
for (FollowTaskNumDTO followTask : followTaskList) { for (FollowTaskNumDTO followTask : followTaskList) {
noticeService.sendFeiShuNotice(FeiShuNoticeMsgEnum.FOLLOW_TASK, Arrays.asList(followTask.getFollowUserId()), FollowTaskNumDTO.getMessageContent(followTask)); eventCenterHttpRequest.sendFeiShuNotice(FeiShuNoticeMsgEnum.FOLLOW_TASK, Arrays.asList(followTask.getFollowUserId()), FollowTaskNumDTO.getMessageContent(followTask));
} }
} }
} }
@@ -269,13 +272,13 @@ public class FollowTaskServiceImpl implements FollowTaskService {
return lineInfo; return lineInfo;
} }
private void sendMessage(HyFollowTaskDO task){ private void sendMessage(HyFollowTaskDO task) throws ApiException {
PartnerSimpleInfoDTO partnerInfo = hyPartnerLineInfoDAO.getPartnerSimpleInfoByLineId(task.getPartnerLineId()); PartnerSimpleInfoDTO partnerInfo = hyPartnerLineInfoDAO.getPartnerSimpleInfoByLineId(task.getPartnerLineId());
if(Objects.isNull(partnerInfo)){ if(Objects.isNull(partnerInfo)){
return; return;
} }
String dateline = DateUtil.format(task.getDeadline(), CoolDateUtils.DATE_FORMAT_SEC_7); String dateline = DateUtil.format(task.getDeadline(), CoolDateUtils.DATE_FORMAT_SEC_7);
String content = MessageFormat.format(MessageConstants.FOLLOW_TASK_MESSAGE_CONTENT, dateline, partnerInfo.getUsername(), partnerInfo.getMobile()); String content = MessageFormat.format(MessageConstants.FOLLOW_TASK_MESSAGE_CONTENT, dateline, partnerInfo.getUsername(), partnerInfo.getMobile());
noticeService.sendFeiShuNotice(FeiShuNoticeMsgEnum.FOLLOW_TASK, Arrays.asList(task.getFollowUserId()), content); eventCenterHttpRequest.sendFeiShuNotice(FeiShuNoticeMsgEnum.FOLLOW_TASK, Arrays.asList(task.getFollowUserId()), content);
} }
} }

View File

@@ -14,7 +14,9 @@ import com.cool.store.dto.log.WantInfoUpdateDTO;
import com.cool.store.dto.partner.PartnerIntentApplyInfoDTO; import com.cool.store.dto.partner.PartnerIntentApplyInfoDTO;
import com.cool.store.entity.*; import com.cool.store.entity.*;
import com.cool.store.enums.*; import com.cool.store.enums.*;
import com.cool.store.exception.ApiException;
import com.cool.store.exception.ServiceException; import com.cool.store.exception.ServiceException;
import com.cool.store.http.EventCenterHttpRequest;
import com.cool.store.mapper.HyPartnerLabelMapper; import com.cool.store.mapper.HyPartnerLabelMapper;
import com.cool.store.mapper.HyPartnerUserChannelMapper; import com.cool.store.mapper.HyPartnerUserChannelMapper;
import com.cool.store.request.BaseUserInfoRequest; import com.cool.store.request.BaseUserInfoRequest;
@@ -80,6 +82,8 @@ public class HyPartnerIntentInfoServiceImpl implements HyPartnerIntentInfoServic
private NoticeService noticeService; private NoticeService noticeService;
@Resource @Resource
HyPartnerUserChannelDAO hyPartnerUserChannelDAO; HyPartnerUserChannelDAO hyPartnerUserChannelDAO;
@Autowired
EventCenterHttpRequest eventCenterHttpRequest;
@Override @Override
public PageInfo<PartnerIntentApplyInfoVO> getPartnerIntentApplyList(String userId, String type, Integer pageSize, Integer pageNumber,String keyword, Integer callStatus, public PageInfo<PartnerIntentApplyInfoVO> getPartnerIntentApplyList(String userId, String type, Integer pageSize, Integer pageNumber,String keyword, Integer callStatus,
@@ -193,7 +197,7 @@ public class HyPartnerIntentInfoServiceImpl implements HyPartnerIntentInfoServic
} }
@Override @Override
public Integer submitPartnerIntentInfo(PartnerIntentInfoRequest request) { public Integer submitPartnerIntentInfo(PartnerIntentInfoRequest request) throws ApiException {
boolean isUpdateIntentInfo = true; boolean isUpdateIntentInfo = true;
log.info("HyPartnerClerkServiceImpl#submitPartnerIntentInfo request:{}", JSONObject.toJSONString(request)); log.info("HyPartnerClerkServiceImpl#submitPartnerIntentInfo request:{}", JSONObject.toJSONString(request));
if (StringUtil.isBlank(request.getPartnerId()) || Objects.isNull(request.getPartnerLineId())){ if (StringUtil.isBlank(request.getPartnerId()) || Objects.isNull(request.getPartnerLineId())){
@@ -251,7 +255,7 @@ public class HyPartnerIntentInfoServiceImpl implements HyPartnerIntentInfoServic
if(flag){//分配招商经理成功才发送分配招商经理的飞书工作通知 if(flag){//分配招商经理成功才发送分配招商经理的飞书工作通知
String dateTime = DateUtil.format(new Date(), CoolDateUtils.DATE_FORMAT_SEC_7); String dateTime = DateUtil.format(new Date(), CoolDateUtils.DATE_FORMAT_SEC_7);
noticeService.sendFeiShuNotice(FeiShuNoticeMsgEnum.ALLOCATION_INVESTMENT_MANAGER,userIdList,dateTime,hyPartnerUserInfoDO.getUsername(),hyPartnerUserInfoDO.getMobile()); eventCenterHttpRequest.sendFeiShuNotice(FeiShuNoticeMsgEnum.ALLOCATION_INVESTMENT_MANAGER,userIdList,dateTime,hyPartnerUserInfoDO.getUsername(),hyPartnerUserInfoDO.getMobile());
} }
} }
if(!isUpdateIntentInfo){ if(!isUpdateIntentInfo){
@@ -259,7 +263,7 @@ public class HyPartnerIntentInfoServiceImpl implements HyPartnerIntentInfoServic
userIdList.add(hyPartnerLineInfoDO.getInvestmentManager()); userIdList.add(hyPartnerLineInfoDO.getInvestmentManager());
} }
String dateTime = DateUtil.format(new Date(), CoolDateUtils.DATE_FORMAT_SEC_7); String dateTime = DateUtil.format(new Date(), CoolDateUtils.DATE_FORMAT_SEC_7);
noticeService.sendFeiShuNotice(FeiShuNoticeMsgEnum.INTENTION_APPLY,userIdList,hyPartnerUserInfoDO.getUsername(),hyPartnerUserInfoDO.getMobile(), dateTime); eventCenterHttpRequest.sendFeiShuNotice(FeiShuNoticeMsgEnum.INTENTION_APPLY,userIdList,hyPartnerUserInfoDO.getUsername(),hyPartnerUserInfoDO.getMobile(), dateTime);
} }
//记录日志 //记录日志
PartnerUserInfoVO operator = PartnerUserHolder.getUser(); PartnerUserInfoVO operator = PartnerUserHolder.getUser();

View File

@@ -14,6 +14,7 @@ import com.cool.store.entity.*;
import com.cool.store.enums.*; import com.cool.store.enums.*;
import com.cool.store.exception.ApiException; import com.cool.store.exception.ApiException;
import com.cool.store.exception.ServiceException; import com.cool.store.exception.ServiceException;
import com.cool.store.http.EventCenterHttpRequest;
import com.cool.store.mapper.HyPartnerUserChannelMapper; import com.cool.store.mapper.HyPartnerUserChannelMapper;
import com.cool.store.request.*; import com.cool.store.request.*;
import com.cool.store.service.*; import com.cool.store.service.*;
@@ -85,6 +86,8 @@ public class HyPartnerLineInfoServiceImpl implements HyPartnerLineInfoService {
@Autowired @Autowired
private NoticeService noticeService; private NoticeService noticeService;
@Autowired
private EventCenterHttpRequest eventCenterHttpRequest;
@Resource @Resource
LabelService labelService; LabelService labelService;
@@ -204,14 +207,14 @@ public class HyPartnerLineInfoServiceImpl implements HyPartnerLineInfoService {
HyPartnerUserInfoDO hyPartnerUserInfoDO = hyPartnerUserInfoDAO.selectByPartnerId(hyPartnerLineInfoDO.getPartnerId()); HyPartnerUserInfoDO hyPartnerUserInfoDO = hyPartnerUserInfoDAO.selectByPartnerId(hyPartnerLineInfoDO.getPartnerId());
//发送飞书工作通知 //发送飞书工作通知
if (sendFlag){ if (sendFlag){
noticeService.sendFeiShuNotice(FeiShuNoticeMsgEnum.TRANS_INVESTMENT_MANAGER,Arrays.asList(request.getUserId()),dateTime,hyPartnerUserInfoDO.getUsername(),hyPartnerUserInfoDO.getMobile()); eventCenterHttpRequest.sendFeiShuNotice(FeiShuNoticeMsgEnum.TRANS_INVESTMENT_MANAGER,Arrays.asList(request.getUserId()),dateTime,hyPartnerUserInfoDO.getUsername(),hyPartnerUserInfoDO.getMobile());
} }
//如果是面试预约待审批阶段还要发送面试预约申请通知 //如果是面试预约待审批阶段还要发送面试预约申请通知
if (WorkflowStageEnum.RESERVATION.getCode().equals(hyPartnerLineInfoDO.getWorkflowStage()) && WorkflowStatusEnum.RESERVATION_1.getCode().equals(hyPartnerLineInfoDO.getWorkflowStatus())) { if (WorkflowStageEnum.RESERVATION.getCode().equals(hyPartnerLineInfoDO.getWorkflowStage()) && WorkflowStatusEnum.RESERVATION_1.getCode().equals(hyPartnerLineInfoDO.getWorkflowStatus())) {
HyPartnerInterviewPlanDO interviewPlanByLine = hyPartnerInterviewPlanDAO.getInterviewPlanByLineId(request.getLineId()); HyPartnerInterviewPlanDO interviewPlanByLine = hyPartnerInterviewPlanDAO.getInterviewPlanByLineId(request.getLineId());
if (interviewPlanByLine!=null && interviewPlanByLine.getStartTime()!=null ){ if (interviewPlanByLine!=null && interviewPlanByLine.getStartTime()!=null ){
String startTime = DateUtil.format(interviewPlanByLine.getStartTime(), CoolDateUtils.DATE_FORMAT_SEC_7); String startTime = DateUtil.format(interviewPlanByLine.getStartTime(), CoolDateUtils.DATE_FORMAT_SEC_7);
noticeService.sendFeiShuNotice(FeiShuNoticeMsgEnum.INTERVIEW_APPOINTMENT, Arrays.asList(request.getUserId()),hyPartnerUserInfoDO.getUsername(),hyPartnerUserInfoDO.getMobile(),startTime); eventCenterHttpRequest.sendFeiShuNotice(FeiShuNoticeMsgEnum.INTERVIEW_APPOINTMENT, Arrays.asList(request.getUserId()),hyPartnerUserInfoDO.getUsername(),hyPartnerUserInfoDO.getMobile(),startTime);
} }
} }
@@ -269,11 +272,11 @@ public class HyPartnerLineInfoServiceImpl implements HyPartnerLineInfoService {
} }
try { try {
if (successLineIds.size()>1){ if (successLineIds.size()>1){
noticeService.sendFeiShuNotice(FeiShuNoticeMsgEnum.BATCH_TRANS_INVESTMENT_MANAGER,Arrays.asList(request.getUserId()),successLineIds.size(),DateUtil.format(new Date(),CoolDateUtils.DATE_FORMAT_SEC_7)); eventCenterHttpRequest.sendFeiShuNotice(FeiShuNoticeMsgEnum.BATCH_TRANS_INVESTMENT_MANAGER,Arrays.asList(request.getUserId()),successLineIds.size(),DateUtil.format(new Date(),CoolDateUtils.DATE_FORMAT_SEC_7));
}else if (successLineIds.size()==1){ }else if (successLineIds.size()==1){
String dateTime = DateUtil.format(new Date(), CoolDateUtils.DATE_FORMAT_SEC_7); String dateTime = DateUtil.format(new Date(), CoolDateUtils.DATE_FORMAT_SEC_7);
HyPartnerUserInfoDO hyPartnerUserInfoDO = partnerUserInfoDOMap.get(partnerMap.get(successLineIds.get(0))); HyPartnerUserInfoDO hyPartnerUserInfoDO = partnerUserInfoDOMap.get(partnerMap.get(successLineIds.get(0)));
noticeService.sendFeiShuNotice(FeiShuNoticeMsgEnum.TRANS_INVESTMENT_MANAGER,Arrays.asList(request.getUserId()),dateTime,hyPartnerUserInfoDO.getUsername(),hyPartnerUserInfoDO.getMobile()); eventCenterHttpRequest.sendFeiShuNotice(FeiShuNoticeMsgEnum.TRANS_INVESTMENT_MANAGER,Arrays.asList(request.getUserId()),dateTime,hyPartnerUserInfoDO.getUsername(),hyPartnerUserInfoDO.getMobile());
} }
} catch (Exception e) { } catch (Exception e) {
log.info("batchTransferInvestmentManager_error:{}",e.getMessage()); log.info("batchTransferInvestmentManager_error:{}",e.getMessage());
@@ -329,8 +332,11 @@ public class HyPartnerLineInfoServiceImpl implements HyPartnerLineInfoService {
userIdList.add(userId); userIdList.add(userId);
HyPartnerUserInfoDO hyPartnerUserInfoDO = hyPartnerUserInfoDAO.selectByPartnerId(x.getPartnerId()); HyPartnerUserInfoDO hyPartnerUserInfoDO = hyPartnerUserInfoDAO.selectByPartnerId(x.getPartnerId());
String dateTime = DateUtil.format(new Date(), CoolDateUtils.DATE_FORMAT_SEC_7); String dateTime = DateUtil.format(new Date(), CoolDateUtils.DATE_FORMAT_SEC_7);
noticeService.sendFeiShuNotice(FeiShuNoticeMsgEnum.ALLOCATION_INVESTMENT_MANAGER,userIdList,dateTime,hyPartnerUserInfoDO.getUsername(),hyPartnerUserInfoDO.getMobile()); try {
eventCenterHttpRequest.sendFeiShuNotice(FeiShuNoticeMsgEnum.ALLOCATION_INVESTMENT_MANAGER,userIdList,dateTime,hyPartnerUserInfoDO.getUsername(),hyPartnerUserInfoDO.getMobile());
} catch (ApiException e) {
throw new RuntimeException(e);
}
LineLogInfo lineLogInfo = new LineLogInfo(x.getPartnerId(), x.getId(), operateUser.getUserId(), LineLogInfo lineLogInfo = new LineLogInfo(x.getPartnerId(), x.getId(), operateUser.getUserId(),
operateUser.getName(), OperateTypeEnum.ALLOCATION_INVESTMENT_MANAGER, operateUser.getName(), OperateTypeEnum.ALLOCATION_INVESTMENT_MANAGER,
WorkflowStageEnum.getWorkflowStageByCode(x.getWorkflowStage()), WorkflowStageEnum.getWorkflowStageByCode(x.getWorkflowStage()),
@@ -839,7 +845,7 @@ public class HyPartnerLineInfoServiceImpl implements HyPartnerLineInfoService {
return null; return null;
} }
@Override @Override
public HyPartnerLineInfoDO generateDefaultLineInfo(String partnerId, String wantShopArea, Integer acceptAdjustType,Boolean assignFlag,String investmentManagerId) { public HyPartnerLineInfoDO generateDefaultLineInfo(String partnerId, String wantShopArea, Integer acceptAdjustType,Boolean assignFlag,String investmentManagerId) throws ApiException {
// 生成一条线索 // 生成一条线索
HyPartnerLineInfoDO hyPartnerLineInfoDO = hyPartnerLineInfoDAO.getByPartnerId(partnerId); HyPartnerLineInfoDO hyPartnerLineInfoDO = hyPartnerLineInfoDAO.getByPartnerId(partnerId);
//短信拼接了招商经理 直接使用 不需要走自动分配的逻辑 其他方式 走自动分配 //短信拼接了招商经理 直接使用 不需要走自动分配的逻辑 其他方式 走自动分配
@@ -875,13 +881,13 @@ public class HyPartnerLineInfoServiceImpl implements HyPartnerLineInfoService {
userIdList.add(investmentManager); userIdList.add(investmentManager);
HyPartnerUserInfoDO hyPartnerUserInfoDO = hyPartnerUserInfoDAO.selectByPartnerId(partnerId); HyPartnerUserInfoDO hyPartnerUserInfoDO = hyPartnerUserInfoDAO.selectByPartnerId(partnerId);
String dateTime = DateUtil.format(new Date(), CoolDateUtils.DATE_FORMAT_SEC_7); String dateTime = DateUtil.format(new Date(), CoolDateUtils.DATE_FORMAT_SEC_7);
noticeService.sendFeiShuNotice(FeiShuNoticeMsgEnum.ALLOCATION_INVESTMENT_MANAGER,userIdList,dateTime,hyPartnerUserInfoDO.getUsername(),hyPartnerUserInfoDO.getMobile()); eventCenterHttpRequest.sendFeiShuNotice(FeiShuNoticeMsgEnum.ALLOCATION_INVESTMENT_MANAGER,userIdList,dateTime,hyPartnerUserInfoDO.getUsername(),hyPartnerUserInfoDO.getMobile());
} }
return hyPartnerLineInfoDO; return hyPartnerLineInfoDO;
} }
@Override @Override
public Long checkGenerateNewLineId(Long lineId) { public Long checkGenerateNewLineId(Long lineId) throws ApiException {
HyPartnerLineInfoDO hyPartnerLineInfoDO = hyPartnerLineInfoDAO.selectByPrimaryKeySelective(lineId); HyPartnerLineInfoDO hyPartnerLineInfoDO = hyPartnerLineInfoDAO.selectByPrimaryKeySelective(lineId);
// 15天之后可以继续填写意向信息把之前的线索删除 // 15天之后可以继续填写意向信息把之前的线索删除
if(hyPartnerLineInfoDO != null && hyPartnerLineInfoDO.getDeadline() != null && if(hyPartnerLineInfoDO != null && hyPartnerLineInfoDO.getDeadline() != null &&

View File

@@ -12,6 +12,7 @@ import com.cool.store.entity.HyPartnerLineInfoDO;
import com.cool.store.entity.HyPartnerUserInfoDO; import com.cool.store.entity.HyPartnerUserInfoDO;
import com.cool.store.enums.ErrorCodeEnum; import com.cool.store.enums.ErrorCodeEnum;
import com.cool.store.enums.OperateTypeEnum; import com.cool.store.enums.OperateTypeEnum;
import com.cool.store.exception.ApiException;
import com.cool.store.exception.ServiceException; import com.cool.store.exception.ServiceException;
import com.cool.store.request.PartnerIntentInfoRequest; import com.cool.store.request.PartnerIntentInfoRequest;
import com.cool.store.request.PartnerUserInfoRequest; import com.cool.store.request.PartnerUserInfoRequest;
@@ -95,7 +96,7 @@ public class PartnerUserInfoServiceImpl implements PartnerUserInfoService {
} }
@Override @Override
public ApplyBaseInfoVO updatePartnerUserInfo(PartnerUserInfoRequest partnerUserInfoRequest) { public ApplyBaseInfoVO updatePartnerUserInfo(PartnerUserInfoRequest partnerUserInfoRequest) throws ApiException {
log.info("PartnerUserInfoServiceImpl#updatePartnerUserInfo partnerUserInfoRequest:{}", JSONObject.toJSONString(partnerUserInfoRequest)); log.info("PartnerUserInfoServiceImpl#updatePartnerUserInfo partnerUserInfoRequest:{}", JSONObject.toJSONString(partnerUserInfoRequest));
HyPartnerUserInfoDO hyPartnerUserInfoDO = hyPartnerUserInfoDAO.selectByPartnerId(String.valueOf(partnerUserInfoRequest.getPartnerId())); HyPartnerUserInfoDO hyPartnerUserInfoDO = hyPartnerUserInfoDAO.selectByPartnerId(String.valueOf(partnerUserInfoRequest.getPartnerId()));
if (hyPartnerUserInfoDO == null){ if (hyPartnerUserInfoDO == null){

View File

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

View File

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

View File

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

View File

@@ -1,6 +1,8 @@
package com.cool.store.service; package com.cool.store.service;
import cn.hutool.core.util.RandomUtil;
import com.cool.store.enums.FeiShuNoticeMsgEnum; import com.cool.store.enums.FeiShuNoticeMsgEnum;
import com.cool.store.enums.SMSMsgEnum;
import com.cool.store.exception.ApiException; import com.cool.store.exception.ApiException;
import com.cool.store.http.EventCenterHttpRequest; import com.cool.store.http.EventCenterHttpRequest;
import org.junit.Test; import org.junit.Test;
@@ -28,8 +30,58 @@ public class EventRequestTest extends AbstractJUnit4SpringContextTests {
@Test @Test
public void testSendFeiShuNotice() throws ApiException { public void testSendFeiShuNotice() throws ApiException {
//招商企业
//eventCenterHttpRequest.sendFeiShuNotice(FeiShuNoticeMsgEnum.common_notice, Arrays.asList("9818f98c"), "测试"); //eventCenterHttpRequest.sendFeiShuNotice(FeiShuNoticeMsgEnum.common_notice, Arrays.asList("9818f98c"), "测试");
//任务中枢企业
eventCenterHttpRequest.sendFeiShuNotice(FeiShuNoticeMsgEnum.ALLOCATION_INVESTMENT_MANAGER, Arrays.asList("661c6cfg"), "2023-10-24 10:09:04", "测试", "1008611"); 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);
}
} }

View File

@@ -6,6 +6,7 @@ import com.cool.store.entity.HyPartnerBaseInfoDO;
import com.cool.store.enums.ErrorCodeEnum; import com.cool.store.enums.ErrorCodeEnum;
import com.cool.store.enums.IDCardSideEnum; import com.cool.store.enums.IDCardSideEnum;
import com.cool.store.enums.WorkflowStatusEnum; import com.cool.store.enums.WorkflowStatusEnum;
import com.cool.store.exception.ApiException;
import com.cool.store.exception.ServiceException; import com.cool.store.exception.ServiceException;
import com.cool.store.request.*; import com.cool.store.request.*;
import com.cool.store.response.ResponseResult; import com.cool.store.response.ResponseResult;
@@ -52,7 +53,7 @@ public class PartnerController {
@PostMapping(path = "/applyBaseInfo") @PostMapping(path = "/applyBaseInfo")
@ApiOperation("提交加盟商基本信息") @ApiOperation("提交加盟商基本信息")
public ResponseResult<ApplyBaseInfoVO> applyBaseInfo(@RequestBody PartnerUserInfoRequest partnerUserInfoRequest){ public ResponseResult<ApplyBaseInfoVO> applyBaseInfo(@RequestBody PartnerUserInfoRequest partnerUserInfoRequest) throws ApiException {
return ResponseResult.success(partnerUserInfoService.updatePartnerUserInfo(partnerUserInfoRequest)); return ResponseResult.success(partnerUserInfoService.updatePartnerUserInfo(partnerUserInfoRequest));
} }
@@ -112,7 +113,7 @@ public class PartnerController {
@PostMapping(path = "/submitPartnerIntentInfo") @PostMapping(path = "/submitPartnerIntentInfo")
@ApiOperation("提意向书意向信息/行业认知") @ApiOperation("提意向书意向信息/行业认知")
public ResponseResult<Integer> submitPartnerIntentInfo(@RequestBody PartnerIntentInfoRequest partnerIntentInfoRequest){ public ResponseResult<Integer> submitPartnerIntentInfo(@RequestBody PartnerIntentInfoRequest partnerIntentInfoRequest) throws ApiException {
return ResponseResult.success(hyPartnerIntentInfoService.submitPartnerIntentInfo(partnerIntentInfoRequest)); return ResponseResult.success(hyPartnerIntentInfoService.submitPartnerIntentInfo(partnerIntentInfoRequest));
} }
@@ -136,7 +137,7 @@ public class PartnerController {
@PostMapping(path = "/changePartnerIntentInfo") @PostMapping(path = "/changePartnerIntentInfo")
@ApiOperation("修改意向书意向信息/行业认知") @ApiOperation("修改意向书意向信息/行业认知")
public ResponseResult<Integer> changePartnerIntentInfo(@RequestBody PartnerIntentInfoRequest partnerIntentInfoRequest){ public ResponseResult<Integer> changePartnerIntentInfo(@RequestBody PartnerIntentInfoRequest partnerIntentInfoRequest) throws ApiException {
return ResponseResult.success(hyPartnerIntentInfoService.submitPartnerIntentInfo(partnerIntentInfoRequest)); return ResponseResult.success(hyPartnerIntentInfoService.submitPartnerIntentInfo(partnerIntentInfoRequest));
} }
@@ -236,7 +237,7 @@ public class PartnerController {
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(name = "lineId", value = "线索ID", required = false), @ApiImplicitParam(name = "lineId", value = "线索ID", required = false),
}) })
public ResponseResult<Long> checkGenerateNewLineId(@RequestParam(value = "lineId",required = false)Long lineId){ public ResponseResult<Long> checkGenerateNewLineId(@RequestParam(value = "lineId",required = false)Long lineId) throws ApiException {
PartnerUserInfoVO userInfoVO = PartnerUserHolder.getUser(); PartnerUserInfoVO userInfoVO = PartnerUserHolder.getUser();
return ResponseResult.success(hyPartnerLineInfoService.checkGenerateNewLineId(lineId)); return ResponseResult.success(hyPartnerLineInfoService.checkGenerateNewLineId(lineId));
} }