提交 a59b0f72 作者: yanxin

专题启用增加复合专题redis入库处理逻辑

上级 9c91f2d1
...@@ -10,6 +10,8 @@ import com.zzsn.event.vo.SubjectDetailVO; ...@@ -10,6 +10,8 @@ import com.zzsn.event.vo.SubjectDetailVO;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import java.util.List;
/** /**
* @Description: 专题表 * @Description: 专题表
* @Author: jeecg-boot * @Author: jeecg-boot
...@@ -98,4 +100,6 @@ public interface SubjectMapper extends BaseMapper<Subject> { ...@@ -98,4 +100,6 @@ public interface SubjectMapper extends BaseMapper<Subject> {
* @date 2024/4/24 * @date 2024/4/24
*/ */
int ynBelowExcludeGroup(@Param("subjectId") String subjectId, @Param("sourceId") String sourceId); int ynBelowExcludeGroup(@Param("subjectId") String subjectId, @Param("sourceId") String sourceId);
List<String> getBindSubjectIds(@Param("id")String id);
} }
...@@ -206,4 +206,8 @@ ...@@ -206,4 +206,8 @@
</otherwise> </otherwise>
</choose> </choose>
</select> </select>
<select id="getBindSubjectIds" resultType="java.lang.String">
select addition_relation_id from subject_addition where subject_id = #{id} and addition_type = 1
</select>
</mapper> </mapper>
...@@ -58,7 +58,8 @@ import java.util.stream.Collectors; ...@@ -58,7 +58,8 @@ import java.util.stream.Collectors;
@Service @Service
@Slf4j @Slf4j
public class SubjectServiceImpl extends ServiceImpl<SubjectMapper, Subject> implements SubjectService { public class SubjectServiceImpl extends ServiceImpl<SubjectMapper, Subject> implements SubjectService {
@Autowired
private InformationService informationService;
@Autowired @Autowired
private CodeGenerateUtil codeGenerateUtil; private CodeGenerateUtil codeGenerateUtil;
@Autowired @Autowired
...@@ -242,9 +243,14 @@ public class SubjectServiceImpl extends ServiceImpl<SubjectMapper, Subject> impl ...@@ -242,9 +243,14 @@ public class SubjectServiceImpl extends ServiceImpl<SubjectMapper, Subject> impl
if (byId.getFirstOpenTime() == null) { if (byId.getFirstOpenTime() == null) {
updateWrapper.set(Subject::getFirstOpenTime, new Date()); updateWrapper.set(Subject::getFirstOpenTime, new Date());
updateWrapper.set(Subject::getEstimateStatus, "预估中"); updateWrapper.set(Subject::getEstimateStatus, "预估中");
//第一次启用时,添加redis缓存,,用于向专题里进数据 //第一次启用时,添加redis缓存,,用于向专题里进数据
setRedisCache(subjectId); if(byId.getSubjectType() == 3){
//复合专题根据绑定的专题数据时间确定要入库的数据时间范围
List<String> ids = this.baseMapper.getBindSubjectIds(byId.getId());
informationService.supplyByCondition(subjectId, ids);
}else{
setRedisCache(subjectId);
}
} }
} }
this.update(updateWrapper); this.update(updateWrapper);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论