| | |
| | | package org.springblade.modules.article.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | |
| | | import org.springblade.core.secure.utils.AuthUtil; |
| | | import org.springblade.core.tool.utils.SpringUtil; |
| | | import org.springblade.modules.article.entity.Article; |
| | | import org.springblade.modules.article.entity.ArticleIntegralEntity; |
| | | import org.springblade.modules.article.mapper.ArticleMapper; |
| | | import org.springblade.modules.article.service.ArticleService; |
| | | import org.springblade.modules.article.service.IArticleIntegralService; |
| | | import org.springblade.modules.article.vo.ArticleVO; |
| | | import org.springblade.modules.district.entity.DistrictEntity; |
| | | import org.springblade.modules.district.service.IDistrictService; |
| | |
| | | article.setDistrictIdList(stringList); |
| | | return baseMapper.getArticleByDistrictId(article); |
| | | } |
| | | |
| | | /** |
| | | * 文章信息更新 |
| | | * @param objectUpdateWrapper |
| | | * @param id |
| | | * @param houseCode |
| | | * @return |
| | | */ |
| | | @Override |
| | | public boolean updateArticle(UpdateWrapper<Article> objectUpdateWrapper, Long id, String houseCode) { |
| | | boolean update = update(null, objectUpdateWrapper); |
| | | if (update){ |
| | | // 查询对应的文章 |
| | | Article article = getById(id); |
| | | // 只有反诈的有浏览积分 |
| | | if (article.getType()==6) { |
| | | // 添加浏览记录信息 |
| | | ArticleIntegralEntity integralEntity = new ArticleIntegralEntity(); |
| | | integralEntity.setScore(article.getScore()); |
| | | integralEntity.setArticleId(id); |
| | | integralEntity.setHouseCode(houseCode); |
| | | // 插入记录 |
| | | update = SpringUtils.getBean(IArticleIntegralService.class).save(integralEntity); |
| | | } |
| | | } |
| | | // 返回 |
| | | return update; |
| | | } |
| | | } |