package core.process;

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

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

public class C_SchoolFillScoreOpinion extends C_FillInformation {

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

    private static String table="graduation_design_reply_opinion_record_score";
    private static String fileds="reply_school_score_status";

    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);
        String date= Configuration.dateFormat.format(new Date());
        vMap.put("school_opinion_date",date);
        Map<String, String>limits = new HashMap<>();
        limits.put("id",this.getGraduationDesignId());
        fillInformation.addOptions("limits",limits);
        fillInformation.execute(null);
        updateStatus();
    }
    protected boolean check() {
        if(this.getGraduationDesignId()==null||this.getVMap()==null)
            return false;
        return true;
    }
    @Override
    public String getGraduationDesignId() {
        return graduationDesignId;
    }

    @Override
    public void setGraduationDesignId(String graduationDesignId) {
        this.graduationDesignId = graduationDesignId;
    }
    public void setVMap(Map<String, String> vMap) {
        this.vMap = vMap;
    }

    public Map<String, String> getVMap() {
        return 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("school_opinion");
        ls.add("school_score");
        return ls;
    }
}





