diff --git a/coolstore-partner-dao/src/main/java/com/cool/store/dao/HyPartnerExhibitionDAO.java b/coolstore-partner-dao/src/main/java/com/cool/store/dao/HyPartnerExhibitionDAO.java index 2c889d66e..24033b38e 100644 --- a/coolstore-partner-dao/src/main/java/com/cool/store/dao/HyPartnerExhibitionDAO.java +++ b/coolstore-partner-dao/src/main/java/com/cool/store/dao/HyPartnerExhibitionDAO.java @@ -156,4 +156,11 @@ public class HyPartnerExhibitionDAO { } return hyPartnerExhibitionMapper.getLineByExhibitionIds(exhibitionIds); } + + public void updateStatusAfterSubmitIndustry(Long partnerLineId) { + if (partnerLineId == null) { + return; + } + hyPartnerExhibitionMapper.updateStatusAfterSubmitIndustry(partnerLineId); + } } diff --git a/coolstore-partner-dao/src/main/java/com/cool/store/dao/HyPartnerIntentInfoDAO.java b/coolstore-partner-dao/src/main/java/com/cool/store/dao/HyPartnerIntentInfoDAO.java index 11219ca6a..6853c921e 100644 --- a/coolstore-partner-dao/src/main/java/com/cool/store/dao/HyPartnerIntentInfoDAO.java +++ b/coolstore-partner-dao/src/main/java/com/cool/store/dao/HyPartnerIntentInfoDAO.java @@ -3,11 +3,10 @@ package com.cool.store.dao; import com.cool.store.dto.partner.PartnerIntentApplyInfoDTO; import com.cool.store.entity.HyPartnerIntentInfoDO; import com.cool.store.mapper.HyPartnerIntentInfoMapper; -import com.github.pagehelper.PageInfo; -import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; -import org.apache.ibatis.annotations.Param; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Repository; +import org.springframework.transaction.annotation.Transactional; import javax.annotation.Resource; import java.util.ArrayList; @@ -26,7 +25,13 @@ public class HyPartnerIntentInfoDAO { @Resource HyPartnerIntentInfoMapper hyPartnerIntentInfoMapper; - public int insertSelective( HyPartnerIntentInfoDO record){ + @Autowired + HyPartnerExhibitionDAO hyPartnerExhibitionDAO; + + @Transactional + public int insertSelective( HyPartnerIntentInfoDO record){ + //增加修改线索会销状态 + hyPartnerExhibitionDAO.updateStatusAfterSubmitIndustry(record.getPartnerLineId()); return hyPartnerIntentInfoMapper.insertSelective(record); } diff --git a/coolstore-partner-dao/src/main/java/com/cool/store/mapper/HyPartnerExhibitionMapper.java b/coolstore-partner-dao/src/main/java/com/cool/store/mapper/HyPartnerExhibitionMapper.java index 3993ef167..5e66b5ea9 100644 --- a/coolstore-partner-dao/src/main/java/com/cool/store/mapper/HyPartnerExhibitionMapper.java +++ b/coolstore-partner-dao/src/main/java/com/cool/store/mapper/HyPartnerExhibitionMapper.java @@ -116,4 +116,10 @@ public interface HyPartnerExhibitionMapper { * @return */ List getLineByExhibitionIds(List exhibitionIds); + + /** + * 在线索提交意向申请后刷线线索报名会销的状态 + * @param partnerLineId + */ + int updateStatusAfterSubmitIndustry(@Param("partnerLineId") Long partnerLineId); } \ No newline at end of file diff --git a/coolstore-partner-dao/src/main/resources/mapper/HyPartnerExhibitionMapper.xml b/coolstore-partner-dao/src/main/resources/mapper/HyPartnerExhibitionMapper.xml index af5ee20e1..e49fcfb80 100644 --- a/coolstore-partner-dao/src/main/resources/mapper/HyPartnerExhibitionMapper.xml +++ b/coolstore-partner-dao/src/main/resources/mapper/HyPartnerExhibitionMapper.xml @@ -499,4 +499,17 @@ ) + + + UPDATE hy_partner_exhibition t1 + INNER JOIN hy_exhibition t2 ON t1.exhibition_id = t2.id + SET t1.participation_status = 3 + WHERE t1.deleted = 0 + AND t2.deleted = 0 + AND t2.closed_type = 0 + AND partner_line_id = #{partnerLineId} + AND participation_status = 1 + + + \ No newline at end of file diff --git a/coolstore-partner-service/src/main/java/com/cool/store/service/InterviewService.java b/coolstore-partner-service/src/main/java/com/cool/store/service/InterviewService.java index 66009c093..bc2621e35 100644 --- a/coolstore-partner-service/src/main/java/com/cool/store/service/InterviewService.java +++ b/coolstore-partner-service/src/main/java/com/cool/store/service/InterviewService.java @@ -1,7 +1,6 @@ package com.cool.store.service; import com.cool.store.dto.partner.EnterInterviewDto; -import com.cool.store.entity.HyPartnerInterviewPlanDO; import com.cool.store.exception.ApiException; import com.cool.store.request.*; import com.cool.store.vo.EnterInterviewVO; @@ -88,5 +87,5 @@ public interface InterviewService { * @return interview: {@link com.cool.store.entity.HyPartnerInterviewDO}; interviewPlan: {@link com.cool.store.entity.HyPartnerInterviewPlanDO} * @throws ApiException */ - Map agreeInterviewWithoutBook(CreateAppointmentReq request, Boolean whetherBeginInterview, String interviewerId) throws ApiException; + Map agreeInterviewWithoutBook(CreateAppointmentReq request, Boolean whetherBeginInterview, String interviewerId, Boolean needSendSms) throws ApiException; } diff --git a/coolstore-partner-service/src/main/java/com/cool/store/service/impl/InterviewServiceImpl.java b/coolstore-partner-service/src/main/java/com/cool/store/service/impl/InterviewServiceImpl.java index 61764e4ab..ebf27bbfe 100644 --- a/coolstore-partner-service/src/main/java/com/cool/store/service/impl/InterviewServiceImpl.java +++ b/coolstore-partner-service/src/main/java/com/cool/store/service/impl/InterviewServiceImpl.java @@ -761,12 +761,12 @@ public class InterviewServiceImpl implements InterviewService { if (interviewStartTime.isBeforeOrEquals(new Date())) { whetherBeginInterview = true; } - HyPartnerInterviewPlanDO interviewPlanDO = (HyPartnerInterviewPlanDO) agreeInterviewWithoutBook(request, whetherBeginInterview, interviewerId).get("interviewPlan"); + HyPartnerInterviewPlanDO interviewPlanDO = (HyPartnerInterviewPlanDO) agreeInterviewWithoutBook(request, whetherBeginInterview, interviewerId, Boolean.TRUE).get("interviewPlan"); return new CreateAppointmentVO(interviewPlanDO.getId().toString()); } @Transactional - public Map agreeInterviewWithoutBook(CreateAppointmentReq request, Boolean whetherBeginInterview, String interviewerId) throws ApiException { + public Map agreeInterviewWithoutBook(CreateAppointmentReq request, Boolean whetherBeginInterview, String interviewerId, Boolean needSendSms) throws ApiException { //1.创建面试计划 HyPartnerInterviewPlanDO interviewPlanDO = new HyPartnerInterviewPlanDO(); Date now = new Date(); @@ -824,11 +824,13 @@ public class InterviewServiceImpl implements InterviewService { hyPartnerLineInfoMapper.updateByPrimaryKeySelective(hyPartnerLineDO); //4. 异步发送短信给加盟商 - HyPartnerBaseInfoDO partnerBaseInfo = hyPartnerBaseInfoMapper.getByPartnerLineId(request.getPartnerLineId()); - if(partnerBaseInfo == null){ - throw new ServiceException(ErrorCodeEnum.INTERVIEW_PARTNER_NOT_EXIST); + if (Boolean.TRUE.equals(needSendSms)) { + HyPartnerBaseInfoDO partnerBaseInfo = hyPartnerBaseInfoMapper.getByPartnerLineId(request.getPartnerLineId()); + if(partnerBaseInfo == null){ + throw new ServiceException(ErrorCodeEnum.INTERVIEW_PARTNER_NOT_EXIST); + } + eventCenterHttpRequest.sendSmsVariable(partnerBaseInfo.getMobile(), SMSMsgEnum.INTERVIEW_APPOINTMENT_PASS, DateUtil.format(DateUtil.parseDateTime(request.getStartBookingTime()), DatePattern.NORM_DATETIME_MINUTE_PATTERN), wechatMiniAppService.getMiniAppUrl()); } - eventCenterHttpRequest.sendSmsVariable(partnerBaseInfo.getMobile(), SMSMsgEnum.INTERVIEW_APPOINTMENT_PASS, DateUtil.format(DateUtil.parseDateTime(request.getStartBookingTime()), DatePattern.NORM_DATETIME_MINUTE_PATTERN), wechatMiniAppService.getMiniAppUrl()); //5. 记录日志 LoginUserInfo operator = CurrentUserHolder.getUser(); diff --git a/coolstore-partner-service/src/main/java/com/cool/store/service/impl/exhibition/ExhibitionServiceImpl.java b/coolstore-partner-service/src/main/java/com/cool/store/service/impl/exhibition/ExhibitionServiceImpl.java index 505c15e57..cdea240f1 100644 --- a/coolstore-partner-service/src/main/java/com/cool/store/service/impl/exhibition/ExhibitionServiceImpl.java +++ b/coolstore-partner-service/src/main/java/com/cool/store/service/impl/exhibition/ExhibitionServiceImpl.java @@ -112,7 +112,7 @@ public class ExhibitionServiceImpl implements ExhibitionService { //1.2 核验会销签到状态 if (hyPartnerExhibitionDO == null //线索未会销签到并且提交意向申请或未处在预约面试阶段 - || !(hyPartnerExhibitionDO.getParticipationStatus().equals(ExhibitionPartnerStatus.SIGNED.getCode()))) + || !(hyPartnerExhibitionDO.getParticipationStatus().equals(ExhibitionPartnerStatus.APPLIED.getCode()))) { throw new ApiException(ErrorCodeEnum.EXHIBITION_NOT_SIGNED); } @@ -134,7 +134,7 @@ public class ExhibitionServiceImpl implements ExhibitionService { String bookEndTime = DateUtil.offsetMinute(DateUtil.parseDateTime(bookStartTime), 30).toString("yyyy-MM-dd HH:mm:ss"); createAppointmentReq.setStartBookingTime(bookStartTime); createAppointmentReq.setEndBookingTime(bookEndTime); - Map interviewInfoMap = interviewService.agreeInterviewWithoutBook(createAppointmentReq, Boolean.TRUE, CurrentUserHolder.getUserId()); + Map interviewInfoMap = interviewService.agreeInterviewWithoutBook(createAppointmentReq, Boolean.TRUE, CurrentUserHolder.getUserId(), Boolean.FALSE); HyPartnerInterviewPlanDO interviewPlan = (HyPartnerInterviewPlanDO) interviewInfoMap.get("interviewPlan"); HyPartnerInterviewDO interviewInfo = (HyPartnerInterviewDO) interviewInfoMap.get("interview"); @@ -763,7 +763,7 @@ public class ExhibitionServiceImpl implements ExhibitionService { public void sendSMSToExhibitionApplicants() { //1. 查询昨晚被自动结束的会销 HyExhibitionDO hyExhibitionDO = new HyExhibitionDO(); - hyExhibitionDO.setClosedType(2); + hyExhibitionDO.setClosedType(1); String startDayStr = DateUtil.format(DateUtil.offsetDay(new Date(), -1), CoolDateUtils.DATE_FORMAT_DAY); hyExhibitionDO.setStartDateStr(startDayStr); hyExhibitionDO.setDeleted(Boolean.FALSE); diff --git a/coolstore-partner-webb/src/test/java/com/cool/store/service/EventRequestTest.java b/coolstore-partner-webb/src/test/java/com/cool/store/service/EventRequestTest.java index 711412efa..3d7ce4418 100644 --- a/coolstore-partner-webb/src/test/java/com/cool/store/service/EventRequestTest.java +++ b/coolstore-partner-webb/src/test/java/com/cool/store/service/EventRequestTest.java @@ -41,22 +41,22 @@ class EventRequestTest extends AbstractJUnit4SpringContextTests { @Test void testFeishuNotice() throws ApiException { String userId = "34f4a9ga"; -// //1. 工作台通知 -// eventCenterHttpRequest.sendFeiShuNotice(FeiShuNoticeMsgEnum.common_notice, Arrays.asList(userId), "测试"); -// //2. 分配招商经理 -// eventCenterHttpRequest.sendFeiShuNotice(FeiShuNoticeMsgEnum.ALLOCATION_INVESTMENT_MANAGER, Arrays.asList(userId), "2011-12-11 11:11:11", "测试", "1008631"); -// //3. 转让招商经理 -// eventCenterHttpRequest.sendFeiShuNotice(FeiShuNoticeMsgEnum.TRANS_INVESTMENT_MANAGER, Arrays.asList(userId), "2012-11-11 11:11:11", "测试", "1108611"); -// //4. 收到新线索 -// eventCenterHttpRequest.sendFeiShuNotice(FeiShuNoticeMsgEnum.BATCH_TRANS_INVESTMENT_MANAGER, Arrays.asList(userId), "1", "2023-01-24 16:41:07"); -// //5. 加盟意向申请 -// eventCenterHttpRequest.sendFeiShuNotice(FeiShuNoticeMsgEnum.INTENTION_APPLY, Arrays.asList(userId), "测试", "1007611", "2023-09-24 16:42:07"); -// //6. 线索跟进任务 -// eventCenterHttpRequest.sendFeiShuNotice(FeiShuNoticeMsgEnum.FOLLOW_TASK, Arrays.asList(userId), "测试线索跟进任务"); -// //7. 面试预约申请 -// eventCenterHttpRequest.sendFeiShuNotice(FeiShuNoticeMsgEnum.INTERVIEW_APPOINTMENT, Arrays.asList(userId), "测试", "1108611", "2023-10-24 16:43:07"); -// //8. 会销协作通知 -// eventCenterHttpRequest.sendFeiShuNotice(FeiShuNoticeMsgEnum.EXHIBITION_COLLABORATOR, Arrays.asList(userId), "68", "老大", "会销", "2023-12-31", "系东方大酒店"); + //1. 工作台通知 + eventCenterHttpRequest.sendFeiShuNotice(FeiShuNoticeMsgEnum.common_notice, Arrays.asList(userId), "测试"); + //2. 分配招商经理 + eventCenterHttpRequest.sendFeiShuNotice(FeiShuNoticeMsgEnum.ALLOCATION_INVESTMENT_MANAGER, Arrays.asList(userId), "2011-12-11 11:11:11", "测试", "1008631"); + //3. 转让招商经理 + eventCenterHttpRequest.sendFeiShuNotice(FeiShuNoticeMsgEnum.TRANS_INVESTMENT_MANAGER, Arrays.asList(userId), "2012-11-11 11:11:11", "测试", "1108611"); + //4. 收到新线索 + eventCenterHttpRequest.sendFeiShuNotice(FeiShuNoticeMsgEnum.BATCH_TRANS_INVESTMENT_MANAGER, Arrays.asList(userId), "1", "2023-01-24 16:41:07"); + //5. 加盟意向申请 + eventCenterHttpRequest.sendFeiShuNotice(FeiShuNoticeMsgEnum.INTENTION_APPLY, Arrays.asList(userId), "测试", "1007611", "2023-09-24 16:42:07"); + //6. 线索跟进任务 + eventCenterHttpRequest.sendFeiShuNotice(FeiShuNoticeMsgEnum.FOLLOW_TASK, Arrays.asList(userId), "测试线索跟进任务"); + //7. 面试预约申请 + eventCenterHttpRequest.sendFeiShuNotice(FeiShuNoticeMsgEnum.INTERVIEW_APPOINTMENT, Arrays.asList(userId), "测试", "1108611", "2023-10-24 16:43:07"); + //8. 会销协作通知 + eventCenterHttpRequest.sendFeiShuNotice(FeiShuNoticeMsgEnum.EXHIBITION_COLLABORATOR, Arrays.asList(userId), "68", "老大", "会销", "2023-12-31", "系东方大酒店"); //9. 线索报名会销 eventCenterHttpRequest.sendFeiShuNotice(FeiShuNoticeMsgEnum.PARTNER_SIGNUP_EXHIBITION, Arrays.asList(userId), "237298", "e2771d330ec54648841a38607f06b598", "线索客户", "1008611", "2023-10-24", "会销", "蜀山"); }