You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
88 lines
2.4 KiB
88 lines
2.4 KiB
package core.process;
|
|
|
|
import core.operation.UploadFile;
|
|
import error.GExcptInit;
|
|
import error.GExcptSQL;
|
|
|
|
import java.io.File;
|
|
import java.util.HashMap;
|
|
import java.util.Map;
|
|
|
|
public class C_StudentUploadOpeningReport extends C_UploadFile{
|
|
String openingReportURL;
|
|
String graduationDesignId;
|
|
private static String buttonName ="提交开题报告";
|
|
private static String file_type = "opening_report";
|
|
private static String targetURL="/home/student-upload-opening-report";
|
|
private static String iconURL="../cssFile/images/upload.png";
|
|
private static String info = "";
|
|
|
|
private static String table="graduation_design_opening_report";
|
|
private static String field ="opening_report_status";
|
|
|
|
public void uploadOpeningReport() throws Exception{
|
|
if(!check()) throw new GExcptInit("Upload OpeningReport Attrs init error!");
|
|
UploadFile uploadFileOperation=new UploadFile();
|
|
uploadFileOperation.setOptions(new HashMap<>());
|
|
uploadFileOperation.addOptions("file_url",this.getOpeningReportURL());
|
|
uploadFileOperation.addOptions("file_type",file_type);
|
|
Map<String, String>limits = new HashMap<>();
|
|
limits.put("id",this.getGraduationDesignId());
|
|
uploadFileOperation.addOptions("limits",limits);
|
|
uploadFileOperation.execute(null);
|
|
updateStatus();
|
|
}
|
|
|
|
protected boolean check() {
|
|
if(this.getGraduationDesignId()==null||this.getOpeningReportURL()==null)
|
|
return false;
|
|
return true;
|
|
}
|
|
|
|
public String getOpeningReportURL() {
|
|
return openingReportURL;
|
|
}
|
|
|
|
public void setOpeningReportURL(String openingReportURL) {
|
|
this.openingReportURL = openingReportURL;
|
|
}
|
|
|
|
public String getGraduationDesignId() {
|
|
return graduationDesignId;
|
|
}
|
|
|
|
public void setGraduationDesignId(String graduationDesignId) {
|
|
this.graduationDesignId = graduationDesignId;
|
|
}
|
|
|
|
@Override
|
|
public void updateStatus() throws GExcptSQL {
|
|
core.process.Utils.updateStatus(graduationDesignId,table, field);
|
|
}
|
|
|
|
@Override
|
|
public String getInfo() {
|
|
return info;
|
|
}
|
|
|
|
@Override
|
|
public String getTargetURL() {
|
|
return targetURL;
|
|
}
|
|
|
|
@Override
|
|
public String getIconURL() {
|
|
return iconURL;
|
|
}
|
|
|
|
@Override
|
|
public String getButtonName() {
|
|
return buttonName;
|
|
}
|
|
|
|
@Override
|
|
public String getFileType() {
|
|
return "上传开题报告";
|
|
}
|
|
}
|