|
@@ -738,16 +738,10 @@ public class TechnicianMomentServiceImpl extends ServiceImpl<TechnicianMomentMap
|
|
|
throw new ServiceException("审核中的动态不支持删除");
|
|
throw new ServiceException("审核中的动态不支持删除");
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- TechnicianMoment update = new TechnicianMoment();
|
|
|
|
|
- update.setIsDelete(DELETED);
|
|
|
|
|
- update.setUpdateBy(openId);
|
|
|
|
|
- update.setUpdateTime(LocalDateTime.now());
|
|
|
|
|
-
|
|
|
|
|
- LambdaUpdateWrapper<TechnicianMoment> updateWrapper = new LambdaUpdateWrapper<>();
|
|
|
|
|
- updateWrapper.eq(TechnicianMoment::getId, momentId)
|
|
|
|
|
- .eq(TechnicianMoment::getTechnicianId, technician.getId())
|
|
|
|
|
- .eq(TechnicianMoment::getIsDelete, NOT_DELETED);
|
|
|
|
|
- int rows = momentMapper.update(update, updateWrapper);
|
|
|
|
|
|
|
+
|
|
|
|
|
+ LambdaQueryWrapper<TechnicianMoment> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
|
|
+ queryWrapper.eq(TechnicianMoment::getId, momentId);
|
|
|
|
|
+ int rows = momentMapper.delete(queryWrapper);
|
|
|
if (rows <= 0) {
|
|
if (rows <= 0) {
|
|
|
throw new ServiceException("删除动态失败");
|
|
throw new ServiceException("删除动态失败");
|
|
|
}
|
|
}
|