潘志宝
2025-03-18 52725f177acbe4ccf6b1fab059353890c4b55814
iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mdk/sample/SampleInfoConstructor.java
@@ -78,17 +78,20 @@
     */
    protected Date getStartTime(ColumnItem columnItem, Date originalTime) {
        Date dateTime = new Date();
        Calendar calendar = Calendar.getInstance();
        calendar.setTime(originalTime);
        switch (ModelParamType.getEumByCode(columnItem.getParamType())) {
            case DATAPOINT:
            case IND:
            case PLAN:
                dateTime = calculateTime(originalTime, true, columnItem.getDataLength(), columnItem.getGranularity());
                break;
            case PLAN:
                dateTime = calculateTime(originalTime, true, columnItem.getDataLength() + 1, columnItem.getGranularity());
                break;
            case IND:
            case IND_ASCII:
                dateTime = calculateTime(originalTime, true, columnItem.getDataLength() - 1, columnItem.getGranularity());
                break;
            case NORMALITEM:
            case MERGEITEM:
                dateTime = calendar.getTime();
                dateTime = calculateTime(originalTime, false, 1, columnItem.getGranularity());
                break;
            default:
                break;
@@ -110,9 +113,14 @@
        calendar.setTime(originalTime);
        switch (ModelParamType.getEumByCode(columnItem.getParamType())) {
            case DATAPOINT:
            case IND:
                dateTime = calculateTime(originalTime, true, 1, columnItem.getGranularity());
                break;
            case PLAN:
                dateTime = calendar.getTime();
                dateTime = calculateTime(originalTime, true, 1, columnItem.getGranularity());
                break;
            case IND:
            case IND_ASCII:
                dateTime = originalTime;
                break;
            case NORMALITEM:
            case MERGEITEM:
@@ -131,7 +139,7 @@
     * @return
     * @throws Exception
     */
    protected Integer getGranularity(ColumnItem columnItem,Map<String, ApiPointDTO> pointMap, Map<String, ApiPlanItemDTO> planMap) {
    protected Integer getGranularity(ColumnItem columnItem,Map<String, ApiPointDTO> pointMap, Map<String, ApiPlanItemDTO> planMap,Map<String, ApiIndItemDTO> indMap) {
        // 默认60s
        Integer granularity = 60;
        switch (ModelParamType.getEumByCode(columnItem.getParamType())) {
@@ -144,7 +152,8 @@
                granularity = mmPredictItemService.getItemByOutPutId(columnItem.getParamId()).getGranularity();
                break;
            case IND:
                ApiIndItemDTO indItemDTO = indItemApi.getInfoById(columnItem.getParamId());
            case IND_ASCII:
                ApiIndItemDTO indItemDTO = indMap.get(columnItem.getParamId());
                granularity = TimeGranularitySecEnum.getEumByCode(indItemDTO.getTimeGranularity()).getValue();;
                break;
            case PLAN: