package core.process;

import core.operation.FillInformation;
import error.GExcptInit;
import gdms.Configuration;

import java.text.SimpleDateFormat;
import java.util.*;

//评阅老师评阅
public class C_ReviewerFillReview extends C_FillInformation {
    public String graduationDesignId;
    public Map<String,String> vMap;
    private static String buttonName ="评阅老师评阅";
    private static String iconURL="../cssFile/images/fill.png";
    private static String targetURL="/home/reviewer-fill-review";
    private static String info = "";

    private static String table="graduation_design_finished_product_reviewer_score";
    private static String fileds="finished_product_reviewer_score_status";

    public void TeacherTeamFillOpeningReportOpinion() throws Exception{
        if(!check()) throw new GExcptInit("ReviewerFillReview Attrs init error!");
        FillInformation fillInformation=new FillInformation();
        fillInformation.setOptions(new HashMap<>());
        fillInformation.addOptions("table",table);
        String date= Configuration.dateFormat.format(new Date());
        vMap.put("reviewer_score_date",date);
        Map<String, String>limits = new HashMap<>();
        limits.put("id",this.getGraduationDesignId());
        fillInformation.addOptions("limits",limits);
        fillInformation.execute(null);
        updateStatus();
    }

    @Override
    protected boolean check() {
        if(this.getGraduationDesignId()==null||this.getVMap()==null)
            return false;
        else
            return true;
    }
    public String getGraduationDesignId() {
        return graduationDesignId;
    }
    public void setGraduationDesignId(String teacherID) {
        this.graduationDesignId = graduationDesignId;
    }
    public Map<String, String> getVMap() {
        return vMap;
    }
    public void setVMap(Map<String, String> vMap) {
        this.vMap = vMap;
    }
    @Override
    public String getInfo() {
        return info;
    }

    @Override
    public String getTargetURL() {
        return targetURL;
    }

    @Override
    public String getIconURL() {
        return iconURL;
    }

    @Override
    public String getButtonName() {
        return buttonName;
    }

    public List<String> getInputName() {
        List<String> ls = new ArrayList<>();
        ls.add("opinion");
        ls.add("score");
        return ls;
    }
}











