|
|
@@ -11,10 +11,14 @@ import org.springframework.stereotype.Service;
|
|
|
import javax.annotation.Resource;
|
|
|
import java.util.*;
|
|
|
import java.util.Calendar;
|
|
|
+import org.slf4j.Logger;
|
|
|
+import org.slf4j.LoggerFactory;
|
|
|
|
|
|
@Service
|
|
|
public class FamilyMemberAttributeService extends ServiceImpl<FamilyMemberAttributesMapper, FamilyMemberAttributes> {
|
|
|
|
|
|
+ private static final Logger log = LoggerFactory.getLogger(FamilyMemberAttributeService.class);
|
|
|
+
|
|
|
@Resource
|
|
|
private ZodiacConfigMapper zodiacConfigMapper;
|
|
|
|
|
|
@@ -484,4 +488,17 @@ public class FamilyMemberAttributeService extends ServiceImpl<FamilyMemberAttrib
|
|
|
}
|
|
|
return map;
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 清除所有成员的先天分缓存(权重配置变更后调用)
|
|
|
+ */
|
|
|
+ public void invalidateAllInnateScores() {
|
|
|
+ List<FamilyMemberAttributes> all = this.list();
|
|
|
+ for (FamilyMemberAttributes attr : all) {
|
|
|
+ if (attr.getMindBaseScore() != null) attr.setMindBaseScore(null);
|
|
|
+ if (attr.getWisdomBaseScore() != null) attr.setWisdomBaseScore(null);
|
|
|
+ this.updateById(attr);
|
|
|
+ }
|
|
|
+ log.info("已清除 {} 个成员的先天分缓存", all.size());
|
|
|
+ }
|
|
|
}
|