|
@@ -37,27 +37,22 @@ public class LcdInfoServiceImpl implements ILcdInfoService {
|
|
|
* @param id 消息主键
|
|
|
* @return 消息
|
|
|
*/
|
|
|
- /* @Override
|
|
|
+ @Override
|
|
|
public List<LcdInfoVo> selectLcdInfoById(Long id) {
|
|
|
|
|
|
- List list = new ArrayList<>();
|
|
|
List<LcdInfo> records = lcdInfoMapper.selectLcdInfoById(id);
|
|
|
List<LcdInfoVo> lcdInfoVos = records.stream().map((item) -> {
|
|
|
LcdInfoVo lcdInfoVo = new LcdInfoVo();
|
|
|
BeanUtils.copyProperties(item , lcdInfoVo);
|
|
|
- List<LcdInfoVo> list1 = lcdInfoMapper.selectMobile(id);
|
|
|
- list.add(list1);
|
|
|
- lcdInfoVo.setmobile(String.valueOf(list));
|
|
|
+ List<String> list1 = lcdInfoMapper.selectMobile(id);
|
|
|
+ lcdInfoVo.setMobile(list1);
|
|
|
return lcdInfoVo;
|
|
|
}).collect(Collectors.toList());
|
|
|
return lcdInfoVos;
|
|
|
}
|
|
|
-*/
|
|
|
|
|
|
- @Override
|
|
|
- public List<LcdInfoVo> selectLcdInfoById(Long id) {
|
|
|
- return null;
|
|
|
- }
|
|
|
+
|
|
|
+
|
|
|
|
|
|
/**
|
|
|
* 查询消息列表
|
|
@@ -79,11 +74,13 @@ public class LcdInfoServiceImpl implements ILcdInfoService {
|
|
|
@Override
|
|
|
public int insertLcdInfo(LcdInfoVo lcdInfoVo) {
|
|
|
lcdInfoVo.setCreateTime(DateUtils.getNowDate());
|
|
|
+ //插入前端传入的数据
|
|
|
int id = lcdInfoMapper.insertLcdInfo(lcdInfoVo);
|
|
|
+ //根据前端传入数据查询消息id
|
|
|
long info_id =lcdInfoVo.getId();
|
|
|
for (int i = 0; i < lcdInfoVo.getMobile().size(); i++) {
|
|
|
- int userId = lcdInfoMapper.selectUserId(lcdInfoVo.getMobile().get(i));
|
|
|
- LcdInfoUserRelation lcdInfoUserRelation = new LcdInfoUserRelation();
|
|
|
+ int userId = lcdInfoMapper.selectUserId(lcdInfoVo.getMobile().get(i));//根据电话号获取userId
|
|
|
+ LcdInfoUserRelation lcdInfoUserRelation = new LcdInfoUserRelation();//插入中间表数据
|
|
|
lcdInfoUserRelation.setLcdInfoId(info_id);
|
|
|
lcdInfoUserRelation.setLcdReceiveUserId(userId);
|
|
|
lcdInfoUserRelationMapper.insertLcdInfoUserRelation(lcdInfoUserRelation);
|