fix
This commit is contained in:
@@ -15,6 +15,7 @@ import com.cool.store.request.PointLinePageRequest;
|
||||
import com.cool.store.request.PublicLineListRequest;
|
||||
import com.github.pagehelper.Page;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.google.common.collect.Maps;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
@@ -22,7 +23,9 @@ import org.springframework.stereotype.Repository;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author zhangchenbiao
|
||||
@@ -158,4 +161,17 @@ public class LineInfoDAO {
|
||||
public List<PlanLineDTO> getLines(List<Long> lineIdList){
|
||||
return lineInfoMapper.getLines(lineIdList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取线索手机号
|
||||
* @param lineIds
|
||||
* @return
|
||||
*/
|
||||
public Map<Long, String> getLineMobileMap(List<Long> lineIds){
|
||||
if(CollectionUtils.isEmpty(lineIds)){
|
||||
return Maps.newHashMap();
|
||||
}
|
||||
List<LineInfoDO> lineMobile = lineInfoMapper.getLineMobile(lineIds);
|
||||
return lineMobile.stream().filter(o->StringUtils.isNotBlank(o.getMobile())).collect(Collectors.toMap(LineInfoDO::getId, LineInfoDO::getMobile, (k1, k2)-> k1));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -93,4 +93,11 @@ public interface LineInfoMapper extends Mapper<LineInfoDO> {
|
||||
* @description: 开业运营方案根据line id join enterprise_user 查询
|
||||
*/
|
||||
List<PlanLineDTO> getLines(@Param("lineIdList") List<Long> lineIdList);
|
||||
|
||||
/**
|
||||
* 获取线索手机号
|
||||
* @param lineIds
|
||||
* @return
|
||||
*/
|
||||
List<LineInfoDO> getLineMobile(@Param("lineIds") List<Long> lineIds);
|
||||
}
|
||||
@@ -521,5 +521,17 @@
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="getLineMobile" resultMap="BaseResultMap">
|
||||
select
|
||||
id, mobile
|
||||
from
|
||||
xfsg_line_info
|
||||
where
|
||||
deleted = 0 and id in
|
||||
<foreach collection="lineIds" item="lineId" open="(" separator="," close=")" >
|
||||
#{lineId}
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
||||
@@ -132,6 +132,9 @@ public class CommonService {
|
||||
|
||||
public void sendSms(List<String> poneNumbers, SMSMsgEnum templateCode, Map<String, String> templateParamMap){
|
||||
log.info("templateCode:{}, request:{}, poneNumbers:{}", templateCode.getTitle(), JSONObject.toJSONString(templateParamMap), JSONObject.toJSONString(poneNumbers));
|
||||
if(CollectionUtils.isEmpty(poneNumbers)){
|
||||
return;
|
||||
}
|
||||
List<String> signNameList = new ArrayList<>();
|
||||
signNameList.add("酷店掌");
|
||||
AsyncClient client = null;
|
||||
|
||||
@@ -456,14 +456,16 @@ public class XxlJobHandler {
|
||||
log.info("------今日没有待更新数据------");
|
||||
return;
|
||||
}
|
||||
List<Long> lineIds = interviewList.stream().map(LineInterviewDO::getLineId).collect(Collectors.toList());
|
||||
Map<Long, String> lineMobileMap = lineInfoDAO.getLineMobileMap(lineIds);
|
||||
for (LineInterviewDO interview : interviewList) {
|
||||
Map<String, String> templateParamMap = new HashMap<>();
|
||||
templateParamMap.put("interviewTime", DateUtil.format(interview.getStartTime(), "HH:mm"));
|
||||
if (InterviewTypeEnum.INTERVIEW.getCode().equals(interview.getInterviewType())) {
|
||||
commonService.sendSms(interview.getInterviewerUserId(), SMSMsgEnum.FIRST_INTERVIEW_REMIND, templateParamMap);
|
||||
commonService.sendSms(lineMobileMap.get(interview.getLineId()), SMSMsgEnum.FIRST_INTERVIEW_REMIND, templateParamMap);
|
||||
}
|
||||
if (InterviewTypeEnum.SECOND_INTERVIEW.getCode().equals(interview.getInterviewType())) {
|
||||
commonService.sendSms(interview.getInterviewerUserId(), SMSMsgEnum.SECOND_INTERVIEW_REMIND, templateParamMap);
|
||||
commonService.sendSms(lineMobileMap.get(interview.getLineId()), SMSMsgEnum.SECOND_INTERVIEW_REMIND, templateParamMap);
|
||||
}
|
||||
}
|
||||
XxlJobHelper.handleSuccess();
|
||||
|
||||
Reference in New Issue
Block a user