package com.ots.project.tool.report.MAQ.condition; import com.ots.common.enums.LangTypeEnum; import com.ots.project.exam.domain.TLibraryCode; import com.ots.project.tool.report.MAQ.base.BaseCondition; import lombok.Getter; import lombok.Setter; import lombok.extern.slf4j.Slf4j; import java.util.Map; @Slf4j @Getter @Setter public class PrimaryLeadershipStyle extends BaseCondition { private String name = "PrimaryLeadershipStyle"; @Override public TLibraryCode calculate(Map map, LangTypeEnum langType) { try { String p_task31 = map.get("P_Task31"); String p_people32 = map.get("P_People32"); if (checkParamsIsNull(p_task31, p_people32)) { return null; } Double P_task31 = Double.valueOf(p_task31); Double P_people32 = Double.valueOf(p_people32); String codeId = null; if (P_task31 >= 50 && P_people32 < 50) { codeId = "LIBMAQ25010"; } else if (P_task31 >= 50 && P_people32 >= 50) { codeId = "LIBMAQ25020"; } else if (P_task31 < 50 && P_people32 >= 50) { codeId = "LIBMAQ25030"; } else if (P_task31 < 50 && P_people32 < 50) { codeId = "LIBMAQ25040"; } else { TLibraryCode libraryCode = new TLibraryCode(); String briefContent = "NONE"; libraryCode.setEnglistContent(briefContent); libraryCode.setChineseContent(briefContent); libraryCode.setThaiContent(briefContent); return libraryCode; } return getMaqReportLibrary(map, codeId, langType); } catch (Exception ex) { log.error("PrimaryLeadershipStyle error:{}", ex.getMessage(), ex); return null; } } @Override public Map getMAQwaterDropsImages() { return null; } }