记得上下班打卡 | git大法好,push需谨慎

Commit 84b5900e authored by GaoHu's avatar GaoHu

mongodb重复插入错误异常跳过

parent 676cd727
......@@ -149,7 +149,11 @@ public class SmileSchoolServiceImpl extends ServiceImpl<SmileSchoolMapper, Smile
List<SmileSchool> smileSchools = smileSchoolMapper.selectList(queryWrapper);
smileSchools.forEach(smileSchool->{
SmileSchoolVo smileSchoolVo = new SmileSchoolVo().copy(smileSchool);
try {
mongoTemplate.insert(smileSchoolVo, SmileSchoolVo.class.getSimpleName());
} catch (Exception e) {
log.debug("数据存在:{}",smileSchoolVo);
}
});
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment