⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 workingcalendar.java

📁 著名IT公司ILog的APS高级排产优化引擎
💻 JAVA
字号:
package com.power.pipeengine.InputData;

import java.util.*;
import java.io.*;
import com.power.pipeengine.InputData.*;
import com.power.pipeengine.Entity.*;
import com.power.pipe.*;
import com.power.util.Message.*;
import com.power.pipeengine.*;

public class WorkingCalendar extends InputReader
{
    static ResourceBundle res = ResourceBundle.getBundle("com.power.pipeengine.Res",
                                                          EngineConfig.getInstance().getLocale() );
    private String _fileName = "WorkingCalendar";
    private boolean _anyRecords = false;

	public WorkingCalendar() {
	}

	protected String getFileName() {
		return _fileName;
	}

	public void readData() throws Exception {
		BufferedReader d = super.getReader();

        if( null == d ) {
          return;
        }

		String token = GlobalConfig.getInstance().getSeparator();
		String aLine = d.readLine();
		Facilities f = DataModel.getInstance().getFacilities();

		while( aLine != null ) {
            if( aLine.length() <= 1 ) {
                aLine = d.readLine();
                continue;
            }

			StringTokenizer st = new StringTokenizer( aLine, token );

			int facilityID = new Integer( st.nextToken() ).intValue();
			int bucketID   = new Integer( st.nextToken() ).intValue();
			double wdays   = new Double( st.nextToken() ).doubleValue();

			Facility aFacility = f.getFacility( facilityID );
            if( null == aFacility ) {
                reportError( "Facility ID", new Integer( facilityID ).toString(), aLine );
                aLine = d.readLine();
                continue;
            }

            if( null == DataModel.getInstance().getCalendar().getBucket( bucketID ) ) {
                reportError( "Bucket ID", new Integer( bucketID ).toString(), aLine );
                aLine = d.readLine();
                continue;
            }

			f.addWorkingCalendarForFacility( facilityID, bucketID, wdays );
            _anyRecords = true;

			aLine = d.readLine();
		}

		d.close();
        super.closeURLConnection();
        checkDataSufficiency();
	}

    private void checkDataSufficiency() {
      if( _anyRecords == false ) {
          MessageArea.getInstance().addMessage(
            res.getString("Engine17007") +
            res.getString("required_to_create_a") );

        EngineConfig.getInstance().setDataSufficiency( false );
      }
    }

}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -