package com.xintong.visualinspection.pojo;

import lombok.Data;

import java.util.HashMap;

/**
 * 文件名：OtherCheckStatistics
 * 版本信息：日期：2017/12/20 Copyright 江苏省交通规划设计院 Corporation 2017 版权所有.
 */
@Data
public class OtherCheckStatistics {
    private String deptid;
    private String pdeptid;
    private String deptname;
    private String pdeptname;
    private HashMap<String,Integer> scoremap;
    private Integer totalcheck;
    private HashMap<String,HashMap<String,Integer>> scoretypemap;
    private Integer totalScore;
    private String level;



    public void setScoremap(HashMap<String, Integer> scoremap) {
        this.scoremap = scoremap;

        this.totalScore = 1000;
        for (Integer i:scoremap.values()
             ) {
            this.totalScore-=i;
        }
        this.level="优秀";
        if(this.totalScore<1000 && this.totalScore>=985 ){ this.level="优秀";}
        if(this.totalScore<985 && this.totalScore>=950 ){ this.level="优良";}
        if(this.totalScore<950 ){ this.level="合格";}
    }

}
