| | |
| | | import com.zy.acs.manager.system.service.ConfigService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.stereotype.Component; |
| | | import com.zy.acs.common.utils.News; |
| | | |
| | | import javax.annotation.PostConstruct; |
| | | import java.util.ArrayList; |
| | |
| | | |
| | | private final RedisSupport redis = RedisSupport.defaultRedisSupport; |
| | | |
| | | @Value("${floyd.enable}") |
| | | private Boolean floydEnable; |
| | | @Autowired |
| | | private CodeService codeService; |
| | | @Autowired |
| | |
| | | @SuppressWarnings("all") |
| | | @PostConstruct |
| | | public void generateMatrix() { |
| | | if (!floydEnable) { |
| | | return; |
| | | } |
| | | Integer lev = MapDataDispatcher.MAP_DEFAULT_LEV; |
| | | |
| | | String floydHeaderMatrixStr = redis.getValue(RedisConstant.MAP_FLOYD_MATRIX_HEADER_FLAG, String.valueOf(lev)); |
| | |
| | | this.floydMatrix = JSON.parseObject(floydMatrixStr, Double[][].class); |
| | | } else { |
| | | |
| | | log.info("【FLOYD】正在计算矩阵数据......"); |
| | | News.info("【FLOYD】正在计算矩阵数据......"); |
| | | List<Code> codeList = codeService.list(new LambdaQueryWrapper<Code>().eq(Code::getStatus, 1).eq(Code::getDeleted, false)); |
| | | |
| | | int size = codeList.size(); |
| | |
| | | } |
| | | return floydMatrix; |
| | | } |
| | | } |
| | | } |