dengzedong
2 天以前 e691b98e02153c9c439d7f5acb468924572d75d9
iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mdk/sample/SampleInfoConstructor.java
@@ -76,31 +76,19 @@
     * @return
     * @throws Exception
     */
    protected Date getStartTime(ColumnItem columnItem, Date originalTime, Map<String, ApiPointDTO> pointMap, Map<String, ApiPlanItemDTO> planMap) {
    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:
                ApiPointDTO dataPoint = pointMap.get(columnItem.getParamId());
                if (dataPoint == null) {
                    return null;
                }
                dateTime = calculateTime(originalTime, true, columnItem.getDataLength(), DataPointFreqEnum.getEumByCode(dataPoint.getMinfreqid()).getValue());
            case IND:
            case PLAN:
                dateTime = calculateTime(originalTime, true, columnItem.getDataLength(), columnItem.getGranularity());
                break;
            case NORMALITEM:
            case MERGEITEM:
                dateTime = calendar.getTime();
                break;
            case IND:
                dateTime = calculateTime(originalTime, true, columnItem.getDataLength(), 60);
                break;
            case PLAN:
                ApiPlanItemDTO apiPlanItemDTO = planMap.get(columnItem.getParamId());
                if (apiPlanItemDTO == null) {
                    return null;
                }
                dateTime = calculateTime(originalTime, true, columnItem.getDataLength(), TimeGranularitySecEnum.getEumByCode(apiPlanItemDTO.getTimeGranularity()).getValue());
                break;
            default:
                break;
@@ -116,23 +104,19 @@
     * @return
     * @throws Exception
     */
    protected Date getEndTime(ColumnItem columnItem, Date originalTime,Map<String, ApiPointDTO> pointMap, Map<String, ApiPlanItemDTO> planMap) {
    protected Date getEndTime(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 = calendar.getTime();
                break;
            case NORMALITEM:
            case MERGEITEM:
                dateTime = calculateTime(originalTime, false, columnItem.getDataLength(), 60);
                break;
            case IND:
                dateTime = calendar.getTime();
                break;
            case PLAN:
                dateTime = calendar.getTime();
                dateTime = calculateTime(originalTime, false, columnItem.getDataLength(), columnItem.getGranularity());
                break;
            default:
                break;