Merge remote-tracking branch 'origin/cc_20230520_partner' into cc_20230520_partner
This commit is contained in:
@@ -73,6 +73,7 @@ public enum ErrorCodeEnum {
|
||||
INTERVIEW_PLAN_ALREADY_EXIST(1021112, "面试计划已存在,请勿重复申请!", null),
|
||||
INTERVIEW_LINE_ID_IS_NULL(1021113, "线索id为空!", null),
|
||||
INTERVIEW_INTERVIEW_TIME_IS_UNUSABLE(1021114, "当前预约时间不可用,请和线索用户协商其他时间后确定预约时间\n面试人:{0} 手机号:{1}", null),
|
||||
INTERVIEW_PARTNER_NOT_EXIST(1021115, "线索下的加盟商不存在!", null),
|
||||
SIGN_FAIL(600000, "验签失败", null),
|
||||
GET_ACCESSTOKEN_ERROR(600001, "获取小程序TOKEN错误!", null),
|
||||
NEW_MOBILE_HAS_EXIST(600002,"加盟商用户信息已存在",null),
|
||||
|
||||
@@ -302,6 +302,7 @@
|
||||
<select id="getInterviewInfo" resultType="com.cool.store.vo.interview.InterviewVO">
|
||||
select hpip.id as interviewPlanId,
|
||||
hpi.id as interviewId,
|
||||
hpll.id as partnerLineId,
|
||||
hpci.qualify_verify_id as qualifyVerifyId,
|
||||
hpci.intention_contract_no as intentionContractNo,
|
||||
hpi.pass_time as passTime,
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.cool.store.request;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @Author: young.yu
|
||||
* @Date: 2023-06-21 11:17
|
||||
* @Description:
|
||||
*/
|
||||
@Data
|
||||
public class InterviewSmsReq {
|
||||
private String interviewStartTime;
|
||||
}
|
||||
@@ -80,6 +80,11 @@
|
||||
<groupId>org.aspectj</groupId>
|
||||
<artifactId>aspectjweaver</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.aliyun</groupId>
|
||||
<artifactId>dysmsapi20170525</artifactId>
|
||||
<version>2.0.1</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.cool.store.service;
|
||||
|
||||
import com.aliyun.dysmsapi20170525.models.SendSmsResponse;
|
||||
import com.cool.store.exception.ApiException;
|
||||
|
||||
/**
|
||||
* @Author: young.yu
|
||||
* @Date: 2023-06-21 10:55
|
||||
* @Description:
|
||||
*/
|
||||
public interface SmsService {
|
||||
public SendSmsResponse sendSms(String params, String templateCode, String mobile) throws ApiException;
|
||||
}
|
||||
@@ -51,13 +51,13 @@ import java.util.Objects;
|
||||
@Service
|
||||
public class FlowServiceImpl implements FlowService {
|
||||
|
||||
@Value("${hs.mdm.baseUrl}")
|
||||
@Value("${hs.mdm.baseUrl:null}")
|
||||
private String mdmBaseUrl;
|
||||
|
||||
@Value("${hs.mdm.appkey}")
|
||||
@Value("${hs.mdm.appkey:null}")
|
||||
private String mdmAppKey;
|
||||
|
||||
@Value("${hs.mdm.appsec}")
|
||||
@Value("${hs.mdm.appsec:null}")
|
||||
private String mdmAppSec;
|
||||
|
||||
@Autowired
|
||||
|
||||
@@ -1,15 +1,13 @@
|
||||
package com.cool.store.service.impl;
|
||||
|
||||
import cn.hutool.core.convert.Convert;
|
||||
import cn.hutool.core.date.DatePattern;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.cool.store.dto.calendar.*;
|
||||
import com.cool.store.dto.message.SendCardMessageDTO;
|
||||
import com.cool.store.dto.partner.EnterInterviewDto;
|
||||
import com.cool.store.entity.HyPartnerBaseInfoDO;
|
||||
import com.cool.store.entity.EnterpriseUserDO;
|
||||
import com.cool.store.entity.HyPartnerInterviewDO;
|
||||
import com.cool.store.entity.HyPartnerInterviewPlanDO;
|
||||
import com.cool.store.entity.HyPartnerLineInfoDO;
|
||||
import com.cool.store.entity.*;
|
||||
import com.cool.store.enums.ErrorCodeEnum;
|
||||
import com.cool.store.enums.MessageTypeEnum;
|
||||
import com.cool.store.enums.RoomStatus;
|
||||
@@ -18,14 +16,13 @@ import com.cool.store.exception.ApiException;
|
||||
import com.cool.store.exception.ServiceException;
|
||||
import com.cool.store.http.ISVHttpRequest;
|
||||
import com.cool.store.mapper.HyPartnerBaseInfoMapper;
|
||||
import com.cool.store.mapper.EnterpriseUserMapper;
|
||||
import com.cool.store.mapper.HyPartnerInterviewMapper;
|
||||
import com.cool.store.mapper.HyPartnerInterviewPlanMapper;
|
||||
import com.cool.store.mapper.HyPartnerLineInfoMapper;
|
||||
import com.cool.store.request.*;
|
||||
import com.cool.store.service.EnterpriseUserService;
|
||||
import com.cool.store.service.HyPartnerInterviewPlanService;
|
||||
import com.cool.store.service.InterviewService;
|
||||
import com.cool.store.service.SmsService;
|
||||
import com.cool.store.utils.StringUtil;
|
||||
import com.cool.store.utils.TRTCUtils;
|
||||
import com.cool.store.vo.EnterInterviewVO;
|
||||
@@ -40,6 +37,7 @@ import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
@@ -53,18 +51,21 @@ import java.util.List;
|
||||
@Service
|
||||
public class InterviewServiceImpl implements InterviewService {
|
||||
|
||||
@Value("${trtc.sdkAppId}")
|
||||
@Value("${trtc.sdkAppId:null}")
|
||||
private Long sdkAppId;
|
||||
|
||||
@Value("${trtc.secretKey}")
|
||||
@Value("${trtc.secretKey:null}")
|
||||
private String key;
|
||||
|
||||
@Value("${hs.sms.templateCode:null}")
|
||||
private String templateCode;
|
||||
|
||||
@Value("${feishu.notice.link.url:null}")
|
||||
private String linkUrl;
|
||||
|
||||
@Autowired
|
||||
private HyPartnerInterviewPlanMapper hyPartnerInterviewPlanMapper;
|
||||
|
||||
@Autowired
|
||||
private HyPartnerInterviewMapper interviewMapper;
|
||||
|
||||
@Autowired
|
||||
private HyPartnerInterviewMapper hyPartnerInterviewMapper;
|
||||
|
||||
@@ -80,6 +81,9 @@ public class InterviewServiceImpl implements InterviewService {
|
||||
@Autowired
|
||||
private EnterpriseUserService enterpriseUserService;
|
||||
|
||||
@Autowired
|
||||
private SmsService smsService;
|
||||
|
||||
@Override
|
||||
public List<InterviewVO> getInterviewList(GetInterviewListReq request) {
|
||||
List<InterviewVO> interviewList = hyPartnerInterviewPlanMapper.getInterviewList(request);
|
||||
@@ -303,6 +307,17 @@ public class InterviewServiceImpl implements InterviewService {
|
||||
hyPartnerInterviewDO.setStatus(Integer.valueOf(WorkflowStatusEnum.RESERVATION_1.getCode()));
|
||||
hyPartnerInterviewMapper.insertSelective(hyPartnerInterviewDO);
|
||||
|
||||
//异步发送飞书信息给面试官
|
||||
InterviewVO interviewVO = hyPartnerInterviewPlanMapper.getInterviewInfo(String.valueOf(interviewPlanId));
|
||||
List<String> userIds = new ArrayList<>();
|
||||
userIds.add(interviewrId);
|
||||
SendCardMessageDTO sendCardMessageDTO = new SendCardMessageDTO();
|
||||
sendCardMessageDTO.setUserIds(userIds);
|
||||
sendCardMessageDTO.setMessageType(MessageTypeEnum.SCHEDULE_REMINDER);
|
||||
sendCardMessageDTO.setMessageUrl(linkUrl);
|
||||
sendCardMessageDTO.setTitle("面试预约申请");
|
||||
sendCardMessageDTO.setContent(generateFeiShuInterviewMsg(interviewVO.getPartnerName(), interviewVO.getPartnerMobile(), interviewVO.getStartTime()));
|
||||
isvHttpRequest.sendFeiShuCardMessage(sendCardMessageDTO);
|
||||
return vo;
|
||||
}
|
||||
|
||||
@@ -316,11 +331,13 @@ public class InterviewServiceImpl implements InterviewService {
|
||||
throw new ServiceException(ErrorCodeEnum.INTERVIEW_PLAN_NOT_EXIST);
|
||||
}
|
||||
HyPartnerBaseInfoDO partnerBaseInfo = hyPartnerBaseInfoMapper.getByPartnerLineId(interviewVO.getPartnerLineId());
|
||||
if(partnerBaseInfo == null){
|
||||
throw new ServiceException(ErrorCodeEnum.INTERVIEW_PARTNER_NOT_EXIST);
|
||||
}
|
||||
|
||||
|
||||
List<UserFreeBusyInfoDTO> UserFreeBusyInfoList = isvHttpRequest.getFreeBusyList(request.getInterviewerId(), DateUtil.parse(interviewVO.getStartTime()).getTime(), DateUtil.parse(interviewVO.getEndTime()).getTime());
|
||||
if (CollectionUtils.isNotEmpty(UserFreeBusyInfoList)) {
|
||||
throw new ServiceException(ErrorCodeEnum.INTERVIEW_INTERVIEW_TIME_IS_UNUSABLE);
|
||||
List<UserFreeBusyInfoDTO> userFreeBusyInfoList = isvHttpRequest.getFreeBusyList(request.getInterviewerId(), DateUtil.parse(interviewVO.getStartTime()).getTime(), DateUtil.parse(interviewVO.getEndTime()).getTime());
|
||||
if (CollectionUtils.isNotEmpty(userFreeBusyInfoList)) {
|
||||
throw new ServiceException(ErrorCodeEnum.INTERVIEW_INTERVIEW_TIME_IS_UNUSABLE,partnerBaseInfo.getUsername(),partnerBaseInfo.getMobile());
|
||||
}
|
||||
//创建日程信息
|
||||
CreateCalendarEventDTO createCalendarEventDTO = new CreateCalendarEventDTO();
|
||||
@@ -348,15 +365,10 @@ public class InterviewServiceImpl implements InterviewService {
|
||||
hyPartnerInterviewDO.setStatus(Integer.valueOf(WorkflowStatusEnum.INTERVIEW_2.getCode()));
|
||||
hyPartnerInterviewDO.setUpdateTime(new Date());
|
||||
hyPartnerInterviewMapper.updateByPrimaryKeySelective(hyPartnerInterviewDO);
|
||||
//TODO 异步发送短信给加盟商
|
||||
|
||||
//异步发飞书消息给面试官
|
||||
SendCardMessageDTO sendCardMessageDTO = new SendCardMessageDTO();
|
||||
sendCardMessageDTO.setUserIds(Arrays.asList(request.getInterviewerId()));
|
||||
sendCardMessageDTO.setMessageType(MessageTypeEnum.SCHEDULE_REMINDER);
|
||||
sendCardMessageDTO.setTitle("面试预约申请");
|
||||
sendCardMessageDTO.setContent(generateFeiShuInterviewMsg(interviewVO.getPartnerName(), interviewVO.getPartnerMobile(), interviewVO.getStartTime()));
|
||||
isvHttpRequest.sendFeiShuCardMessage(sendCardMessageDTO);
|
||||
//异步发送短信给加盟商
|
||||
InterviewSmsReq interviewSmsReq = new InterviewSmsReq();
|
||||
interviewSmsReq.setInterviewStartTime(DateUtil.format(DateUtil.parse(interviewVO.getStartTime()), DatePattern.NORM_DATETIME_MINUTE_PATTERN));
|
||||
smsService.sendSms(JSON.toJSONString(interviewSmsReq),templateCode, partnerBaseInfo.getMobile());
|
||||
|
||||
}
|
||||
|
||||
@@ -390,7 +402,7 @@ public class InterviewServiceImpl implements InterviewService {
|
||||
hyPartnerInterviewPlanDO.setPartnerId(partnerId);
|
||||
List<HyPartnerInterviewPlanDO> hyPartnerInterviewPlanDOS = hyPartnerInterviewPlanMapper.selectBySelective(hyPartnerInterviewPlanDO);
|
||||
//如果查询结果为空,则去线索中获取招商经理,面试官只有两个阶段,一个是在第一次申请时不存在面试安排直接取招商经理,第二个时面试信息中可修改面试官信息,这个时候以面试信息中为准
|
||||
if (org.springframework.util.CollectionUtils.isEmpty(hyPartnerInterviewPlanDOS)) {
|
||||
if (CollectionUtils.isEmpty(hyPartnerInterviewPlanDOS)) {
|
||||
HyPartnerLineInfoDO hyPartnerLineInfoDO = hyPartnerLineInfoMapper.selectByPrimaryKeySelective(Long.valueOf(lineId));
|
||||
interviewerId = hyPartnerLineInfoDO.getInvestmentManager();
|
||||
}else {
|
||||
|
||||
@@ -0,0 +1,55 @@
|
||||
package com.cool.store.service.impl;
|
||||
|
||||
import com.aliyun.dysmsapi20170525.Client;
|
||||
import com.aliyun.dysmsapi20170525.models.SendSmsRequest;
|
||||
import com.aliyun.dysmsapi20170525.models.SendSmsResponse;
|
||||
import com.aliyun.teaopenapi.models.Config;
|
||||
import com.cool.store.exception.ApiException;
|
||||
import com.cool.store.service.SmsService;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.scheduling.annotation.Async;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* @Author: young.yu
|
||||
* @Date: 2023-06-21 10:55
|
||||
* @Description:
|
||||
*/
|
||||
@Service
|
||||
public class SmsServiceImpl implements SmsService {
|
||||
|
||||
@Value("${hs.sms.accessKeyId:null}")
|
||||
private String accessKeyId ;
|
||||
|
||||
@Value("${hs.sms.accessKeySecret:null}")
|
||||
private String accessKeySecret;
|
||||
|
||||
/**
|
||||
* 发送短信
|
||||
* @param params Json格式的参数
|
||||
* @param mobile
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
@Async
|
||||
public SendSmsResponse sendSms(String params,String templateCode, String mobile) throws ApiException {
|
||||
try {
|
||||
Config config = new Config()
|
||||
// 您的AccessKey ID
|
||||
.setAccessKeyId(accessKeyId)
|
||||
// 您的AccessKey Secret
|
||||
.setAccessKeySecret(accessKeySecret);
|
||||
SendSmsRequest sendSmsRequest = new SendSmsRequest()
|
||||
.setPhoneNumbers(mobile)
|
||||
.setSignName("沪上阿姨")
|
||||
.setTemplateCode(templateCode)
|
||||
.setTemplateParam(params);
|
||||
Client client = new Client(config);
|
||||
return client.sendSms(sendSmsRequest);
|
||||
}catch (ApiException e){
|
||||
throw new ApiException(e.getMessage());
|
||||
} catch (Exception exception) {
|
||||
throw new ApiException(exception.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -69,6 +69,11 @@ hs.mdm.baseUrl=http://10.56.21.30/
|
||||
hs.mdm.appkey = HSAYPartner
|
||||
hs.mdm.appsec = ab39fedb886fa3587c7f517551976de8b2606f5511fd8f8675266825d74c5cd3
|
||||
|
||||
#sms
|
||||
hs.sms.accessKeyId = LTAI4GEZKz9PBqqKa3hjup3W
|
||||
hs.sms.accessKeySecret = iVOiK74k7C1wVbuUbipgJbfpAh1Zdb
|
||||
hs.sms.templateCode = SMS_461530041
|
||||
|
||||
xxl.job.admin.addresses =
|
||||
xxl.job.executor.appname = ${spring.application.name}
|
||||
xxl.job.executor.ip =
|
||||
|
||||
@@ -65,7 +65,5 @@ weixin.appSecret=77abdcae754add92889566b543e5ad79
|
||||
|
||||
signKey=77fea013c3a6459685b83c21a2fc3411
|
||||
|
||||
#MDM
|
||||
hs.mdm.baseUrl=http://10.56.21.30/
|
||||
hs.mdm.appkey = HSAYPartner
|
||||
hs.mdm.appsec = ab39fedb886fa3587c7f517551976de8b2606f5511fd8f8675266825d74c5cd3
|
||||
#飞书通知
|
||||
feishu.notice.link.url = https://applink.feishu.cn/client/web_app/open?appId=cli_a4f3e24dc73a100c&lk_target_url=https%3A%2F%2Ftest-hsay-web.coolstore.cn%2F%23%2Fwork%2Fbench
|
||||
Reference in New Issue
Block a user