|
@@ -73,11 +73,10 @@ 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();
|
|
|
+ lcdInfoVo.setCreateTime(DateUtils.getNowDate());//插入前端传入的数据
|
|
|
+ if (lcdInfoMapper.selectTitleById(lcdInfoVo.getTitle()) == null){
|
|
|
+ int row = lcdInfoMapper.insertLcdInfo(lcdInfoVo);
|
|
|
+ long info_id =lcdInfoVo.getId();//根据前端传入数据查询消息id
|
|
|
for (int i = 0; i < lcdInfoVo.getMobile().size(); i++) {
|
|
|
int userId = lcdInfoMapper.selectUserId(lcdInfoVo.getMobile().get(i));//根据电话号获取userId
|
|
|
LcdInfoUserRelation lcdInfoUserRelation = new LcdInfoUserRelation();//插入中间表数据
|
|
@@ -85,7 +84,8 @@ public class LcdInfoServiceImpl implements ILcdInfoService {
|
|
|
lcdInfoUserRelation.setLcdReceiveUserId(userId);
|
|
|
lcdInfoUserRelationMapper.insertLcdInfoUserRelation(lcdInfoUserRelation);
|
|
|
}
|
|
|
- return id;
|
|
|
+ return row;
|
|
|
+ }else return 0;
|
|
|
}
|
|
|
|
|
|
@Override
|