workingcalendar.java
来自「著名IT公司ILog的APS高级排产优化引擎」· Java 代码 · 共 83 行
JAVA
83 行
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 + =
减小字号Ctrl + -
显示快捷键?