package core.process;

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

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;

public class C_CollegeFillScoreOpinion extends TempProcess{

    String graduationDesignId;
    Map<String,String> vMap;
    protected static String buttonName ="学院老师评分";
    protected static String iconURL="../cssFile/images/fill.png";
    protected static String targetURL="/home/college-fill-score-opinion";
    static  String table="graduation_design_reply_opinion_record_score";
    protected static String info = "";

    public void fillInformation() throws Exception{
        if(!check()) throw new GExcptInit("FillInformation Attrs Init error!");
        FillInformation fillInformation=new FillInformation();
        fillInformation.setOptions(new HashMap<>());
        fillInformation.addOptions("table",table);
        SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-ddHH:mm:ss");
        String date=df.format(new Date());
        vMap.put("college_opinion_date",date);
        Map<String, String>limits = new HashMap<>();
        limits.put("id",this.getGraduationDesignId());
        fillInformation.addOptions("limits",limits);
        fillInformation.execute(null);

    }
    protected boolean check() {
        if(this.getGraduationDesignId()==null||this.getVMap()==null)
            return false;
        return true;
    }

    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;
    }
}
