This commit is contained in:
zhangchenbiao
2024-05-21 10:41:51 +08:00
parent 930649c479
commit 3182f050af
5 changed files with 42 additions and 2 deletions

View File

@@ -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));
}
}

View File

@@ -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);
}

View File

@@ -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>