New file |
| | |
| | | package com.ots.project.tool.report.MAQNEW; |
| | | import com.ots.common.enums.LangTypeEnum; |
| | | import com.ots.common.enums.ReportTypeEnum; |
| | | import com.ots.common.utils.StringUtils; |
| | | import com.ots.project.exam.domain.TLibraryCode; |
| | | import com.ots.project.tool.report.MAQNEW.base.BaseCondition_V2; |
| | | import com.ots.project.tool.report.MAQNEW.base.MAQConditionVO_V2; |
| | | import com.ots.project.tool.report.MAQNEW.base.MAQSummaryCondition_V2; |
| | | import com.ots.project.tool.report.MAQNEW.condition.*; |
| | | import com.ots.project.tool.report.ReportResultData; |
| | | import lombok.Getter; |
| | | import lombok.Setter; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | @Setter |
| | | @Getter |
| | | @Slf4j |
| | | public class MAQReport_V2 { |
| | | private static final String OPENNESSTOEXPERIENCE_1 = "OpennessToExperience_1"; |
| | | private static final String CONSCIENTIOUS_2 = "Conscientious_2"; |
| | | private static final String SOCIALLYOPEN_3 = "SociallyOpen_3"; |
| | | private static final String AGREEABLENESS_4 = "Agreeableness_4"; |
| | | private static final String EMOTIONALBALANCE_5 = "EmotionalBalance_5"; |
| | | private String questionnaireTaker; |
| | | private String questionnaireID; |
| | | private String reportGenerationDate; |
| | | private String userName; |
| | | private String questionnaireEmail; |
| | | private String questionnaireStartTime; |
| | | private String questionnaireEndTime; |
| | | private ReportTypeEnum reportTypeEnum; |
| | | |
| | | private Map otherParams; |
| | | |
| | | private LangTypeEnum langType; |
| | | public List<BaseCondition_V2> getParamList(ReportTypeEnum reportTypeEnum) { |
| | | return init(reportTypeEnum); |
| | | } |
| | | private List<BaseCondition_V2> init(ReportTypeEnum reportTypeEnum) { |
| | | List<BaseCondition_V2> paramList = new ArrayList<>(); |
| | | |
| | | paramList.addAll(getSimpleMessageCoreIds().stream().map(p -> { |
| | | SimpleMessage_V2 simpleMessage = new SimpleMessage_V2(p); |
| | | return simpleMessage; |
| | | }).collect(Collectors.toList())); |
| | | |
| | | paramList.add(new ResponseFidelityDiagnosisTitle_V2()); |
| | | |
| | | paramList.add(new ResponseFidelityDiagnosis_V2()); |
| | | |
| | | paramList.addAll(getScoreCharacteristicsList().stream().map(p -> { |
| | | ScoreCharacteristics_V2 scoreCharacteristics = new ScoreCharacteristics_V2(p); |
| | | return scoreCharacteristics; |
| | | }).collect(Collectors.toList())); |
| | | |
| | | paramList.addAll(getDataInit().stream().map(item -> { |
| | | MAQCondition_V2 maqCondition = new MAQCondition_V2(item); |
| | | return maqCondition; |
| | | }).collect(Collectors.toList())); |
| | | paramList.add(new PrimaryLeadershipStyle_V2()); |
| | | paramList.add(new PrimaryLeadershipStyleContext_V2()); |
| | | |
| | | |
| | | paramList.add(new KeyPointsStrengths_V2()); |
| | | paramList.add(new KeyPointsCautions_V2()); |
| | | |
| | | paramList.add(new MAQSummary_V2(OPENNESSTOEXPERIENCE_1, getMAQSummaryParamList(OPENNESSTOEXPERIENCE_1))); |
| | | paramList.add(new MAQSummary_V2(CONSCIENTIOUS_2, getMAQSummaryParamList(CONSCIENTIOUS_2))); |
| | | paramList.add(new MAQSummary_V2(SOCIALLYOPEN_3, getMAQSummaryParamList(SOCIALLYOPEN_3))); |
| | | paramList.add(new MAQSummary_V2(AGREEABLENESS_4, getMAQSummaryParamList(AGREEABLENESS_4))); |
| | | paramList.add(new MAQSummary_V2(EMOTIONALBALANCE_5, getMAQSummaryParamList(EMOTIONALBALANCE_5))); |
| | | |
| | | return paramList; |
| | | } |
| | | private List<String> getScoreCharacteristicsList() { |
| | | return Arrays.asList("P_Flex01", "P_Creat02", "P_Analyt03", "P_Indep04", "P_Achiev05", |
| | | "P_Initi06", "P_Persis07", "P_Thorou08", "P_Depend09", "P_Plan10", |
| | | "P_Integr11", "P_Energy12", "P_Social13", "P_Lead14", "P_Influ15", |
| | | "P_Team16", "P_Empath17", "P_Polite18", "P_Regula19", "P_ManStr20", |
| | | "P_Confid21", "P_Mind22", "P_SDE23", "P_IM24", "P_INCON25", |
| | | "P_Open26", "P_Consci27", "P_Extrov28", "P_Agree29", "P_EmSt30", |
| | | "P_Task31", "P_People32", "P_Judg33"); |
| | | } |
| | | private List<String> getSimpleMessageCoreIds() { |
| | | return Arrays.asList( |
| | | "LIBMAQV20001", "LIBMAQV20002", "LIBMAQV20003", "LIBMAQV20004", "LIBMAQV20005", |
| | | "LIBMAQV200071", "LIBMAQV20006", "LIBMAQV20009", "LIBMAQV20210", "LIBMAQV200077", |
| | | "LIBMAQV20008", "LIBMAQV20009", "LIBMAQV20010", "LIBMAQV20011", "LIBMAQV20030", |
| | | "LIBMAQV20040", "LIBMAQV20060", "LIBMAQV233000", "LIBMAQV20008", "LIBMAQV20065", |
| | | "LIBMAQV20070", "LIBMAQV20080", "LIBMAQV20085", "LIBMAQV20090", "LIBMAQV2000794", |
| | | "LIBMAQV2000795", "LIBMAQV20095", "LIBMAQV28800", "LIBMAQV20110", |
| | | "LIBMAQV201052", "LIBMAQV20120", "LIBMAQV201102", "LIBMAQV201202", "LIBMAQV20111", |
| | | "LIBMAQV20121", "LIBMAQV20105", "LIBMAQV20131", "LIBMAQV20141", "LIBMAQV20135", |
| | | "LIBMAQV20150", "LIBMAQV20155", "LIBMAQV20160", "LIBMAQV20170", "LIBMAQV20190", |
| | | "LIBMAQV20191", "LIBMAQV20192", "LIBMAQV20193", "LIBMAQV20194", "LIBMAQV20195", |
| | | "LIBMAQV20162", "LIBMAQV20164", "LIBMAQV20200", "LIBMAQV20205", "LIBMAQV20221", |
| | | "LIBMAQV20222", "LIBMAQV20223", "LIBMAQV20224", "LIBMAQV20225", "LIBMAQV20226", |
| | | "LIBMAQV20227", "LIBMAQV20228", "LIBMAQV20229", "LIBMAQV20230", "LIBMAQV20231", |
| | | "LIBMAQV20232", "LIBMAQV20233", "LIBMAQV20234", "LIBMAQV226006", "LIBMAQV20210", |
| | | "LIBMAQV20220", "LIBMAQV231000", "LIBMAQV231010", "LIBMAQV231013", "LIBMAQV232010", |
| | | "LIBMAQV232013", "LIBMAQV225000", "LIBMAQV225042", "LIBMAQV225043", "LIBMAQV225012", |
| | | "LIBMAQV225013", "LIBMAQV225032", "LIBMAQV225033", "LIBMAQV225022", "LIBMAQV225023", |
| | | "LIBMAQV225002", "LIBMAQV233010", "LIBMAQV233020", "LIBMAQV233021", "LIBMAQV233030", |
| | | "LIBMAQV233040", "LIBMAQV233045", "LIBMAQV233050", "LIBMAQV233060", "LIBMAQV226003", |
| | | "LIBMAQV226004", "LIBMAQV227003", "LIBMAQV227004", "LIBMAQV228003", "LIBMAQV228004", |
| | | "LIBMAQV229003", "LIBMAQV229004", "LIBMAQV230003", "LIBMAQV230004", "LIBMAQV21001", |
| | | "LIBMAQV21002", "LIBMAQV21007", "LIBMAQV22002", "LIBMAQV22007", "LIBMAQV23002", "LIBMAQV23007", |
| | | "LIBMAQV24002", "LIBMAQV24007", "LIBMAQV25002", "LIBMAQV25007", "LIBMAQV26002", "LIBMAQV26007", |
| | | "LIBMAQV27002", "LIBMAQV27007", "LIBMAQV28802", "LIBMAQV28007", "LIBMAQV29002", "LIBMAQV29007", |
| | | "LIBMAQV210002", "LIBMAQV210007", "LIBMAQV211002", "LIBMAQV211007", "LIBMAQV212002", "LIBMAQV212007", |
| | | "LIBMAQV213002", "LIBMAQV213007", "LIBMAQV214002", "LIBMAQV214007", "LIBMAQV215002", "LIBMAQV215007", |
| | | "LIBMAQV216002", "LIBMAQV216007", "LIBMAQV217002", "LIBMAQV217007", "LIBMAQV218002", "LIBMAQV218007", |
| | | "LIBMAQV219002", "LIBMAQV219007", "LIBMAQV220002", "LIBMAQV220007", "LIBMAQV221002", "LIBMAQV221007", |
| | | "LIBMAQV222002", "LIBMAQV222007", "LIBMAQV226001", "LIBMAQV226002", "LIBMAQV21000", "LIBMAQV21001", "LIBMAQV22000", |
| | | "LIBMAQV22001", "LIBMAQV23000", "LIBMAQV23001", "LIBMAQV24000", "LIBMAQV24001", "LIBMAQV227001", "LIBMAQV2270015", "LIBMAQV228002", |
| | | "LIBMAQV25000", "LIBMAQV25001", "LIBMAQV26000", "LIBMAQV26001", "LIBMAQV27000", "LIBMAQV27001", "LIBMAQV229002", |
| | | "LIBMAQV28000", "LIBMAQV28001", "LIBMAQV227002", "LIBMAQV29000", "LIBMAQV29001", "LIBMAQV210000", "LIBMAQV230002", |
| | | "LIBMAQV210001", "LIBMAQV211000", "LIBMAQV211001", "LIBMAQV228001", "LIBMAQV212000", "LIBMAQV212001", |
| | | "LIBMAQV213000", "LIBMAQV213001", "LIBMAQV214000", "LIBMAQV214001", "LIBMAQV215000", "LIBMAQV215001", |
| | | "LIBMAQV229001", "LIBMAQV216000", "LIBMAQV216001", "LIBMAQV217000", "LIBMAQV217001", "LIBMAQV218000", |
| | | "LIBMAQV218001", "LIBMAQV230001", "LIBMAQV219000", "LIBMAQV219001", "LIBMAQV220000", "LIBMAQV220001", |
| | | "LIBMAQV221000", "LIBMAQV221001", "LIBMAQV222000", "LIBMAQV222001", "LIBMAQV231003", "LIBMAQV231005", |
| | | "LIBMAQV232005", "LIBMAQV231010", "LIBMAQV231013", "LIBMAQV20020", "LIBMAQV233061", "LIBMAQV20007", "LIBMAQV200081", "LIBMAQV28002", |
| | | "LIBMAQV227006", "LIBMAQV228006", "LIBMAQV229006", "LIBMAQV230006", "LIBMAQV233061", "LIBMAQV233062", "LIBMAQV233063", "LIBMAQV233064", "LIBMAQV233065" |
| | | ); |
| | | } |
| | | |
| | | private List<MAQSummaryCondition_V2> getMAQSummaryParamList(String summaryType) { |
| | | List<MAQSummaryCondition_V2> paramList = new ArrayList<>(); |
| | | if (Objects.equals(OPENNESSTOEXPERIENCE_1, summaryType)) { |
| | | paramList.add(new MAQSummaryCondition_V2(new MAQConditionVO_V2(OPENNESSTOEXPERIENCE_1, "Flexibility,灵活性", "P_Flex01", "LIBMAQV210"))); |
| | | paramList.add(new MAQSummaryCondition_V2(new MAQConditionVO_V2(OPENNESSTOEXPERIENCE_1, "Creativity,创造性", "P_Creat02", "LIBMAQV220"))); |
| | | paramList.add(new MAQSummaryCondition_V2(new MAQConditionVO_V2(OPENNESSTOEXPERIENCE_1, "Analytical Approach,分析导向", "P_Analyt03", "LIBMAQV230"))); |
| | | paramList.add(new MAQSummaryCondition_V2(new MAQConditionVO_V2(OPENNESSTOEXPERIENCE_1, "Independence,自主独立", "P_Indep04", "LIBMAQV240"))); |
| | | } else if (Objects.equals(CONSCIENTIOUS_2, summaryType)) { |
| | | paramList.add(new MAQSummaryCondition_V2(new MAQConditionVO_V2(CONSCIENTIOUS_2, "Achievement Orientation,成就导向", "P_Achiev05", "LIBMAQV250"))); |
| | | paramList.add(new MAQSummaryCondition_V2(new MAQConditionVO_V2(CONSCIENTIOUS_2, "Initiative,能动性", "P_Initi06", "LIBMAQV260"))); |
| | | paramList.add(new MAQSummaryCondition_V2(new MAQConditionVO_V2(CONSCIENTIOUS_2, "Persistence,坚持性", "P_Persis07", "LIBMAQV270"))); |
| | | paramList.add(new MAQSummaryCondition_V2(new MAQConditionVO_V2(CONSCIENTIOUS_2, "Thoroughness,细致性", "P_Thorou08", "LIBMAQV280"))); |
| | | paramList.add(new MAQSummaryCondition_V2(new MAQConditionVO_V2(CONSCIENTIOUS_2, "Dependability,可靠性", "P_Depend09", "LIBMAQV290"))); |
| | | paramList.add(new MAQSummaryCondition_V2(new MAQConditionVO_V2(CONSCIENTIOUS_2, "Planning and Organizing,计划/组织性", "P_Plan10", "LIBMAQV2100"))); |
| | | paramList.add(new MAQSummaryCondition_V2(new MAQConditionVO_V2(CONSCIENTIOUS_2, "Trust and Integrity,坦诚守规", "P_Integr11", "LIBMAQV2110"))); |
| | | } else if (Objects.equals(SOCIALLYOPEN_3, summaryType)) { |
| | | paramList.add(new MAQSummaryCondition_V2(new MAQConditionVO_V2(SOCIALLYOPEN_3, "Personal Energy,个人精力", "P_Energy12", "LIBMAQV2120"))); |
| | | paramList.add(new MAQSummaryCondition_V2(new MAQConditionVO_V2(SOCIALLYOPEN_3, "Socially Open,社交主动性", "P_Social13", "LIBMAQV2130"))); |
| | | paramList.add(new MAQSummaryCondition_V2(new MAQConditionVO_V2(SOCIALLYOPEN_3, "Leading Others,支配性", "P_Lead14", "LIBMAQV2140"))); |
| | | paramList.add(new MAQSummaryCondition_V2(new MAQConditionVO_V2(SOCIALLYOPEN_3, "Influence ,影响力", "P_Influ15", "LIBMAQV2150"))); |
| | | } else if (Objects.equals(AGREEABLENESS_4, summaryType)) { |
| | | paramList.add(new MAQSummaryCondition_V2(new MAQConditionVO_V2(AGREEABLENESS_4, "Cooperation & Teamwork,团队合作", "P_Team16", "LIBMAQV2160"))); |
| | | paramList.add(new MAQSummaryCondition_V2(new MAQConditionVO_V2(AGREEABLENESS_4, "Empathetic,同理心", "P_Empath17", "LIBMAQV2170"))); |
| | | paramList.add(new MAQSummaryCondition_V2(new MAQConditionVO_V2(AGREEABLENESS_4, "Polite & Tactful,社交敏感性", "P_Polite18", "LIBMAQV2180"))); |
| | | } else if (Objects.equals(EMOTIONALBALANCE_5, summaryType)) { |
| | | paramList.add(new MAQSummaryCondition_V2(new MAQConditionVO_V2(EMOTIONALBALANCE_5, "Self-Regulation,自控力", "P_Regula19", "LIBMAQV2190"))); |
| | | paramList.add(new MAQSummaryCondition_V2(new MAQConditionVO_V2(EMOTIONALBALANCE_5, "Managing Stress,压力管理", "P_ManStr20", "LIBMAQV2200"))); |
| | | paramList.add(new MAQSummaryCondition_V2(new MAQConditionVO_V2(EMOTIONALBALANCE_5, "Self-Confidence,自信/弹性", "P_Confid21", "LIBMAQV2210"))); |
| | | paramList.add(new MAQSummaryCondition_V2(new MAQConditionVO_V2(EMOTIONALBALANCE_5, "Mindfulness,专注/觉察", "P_Mind22", "LIBMAQV2220"))); |
| | | } |
| | | return paramList; |
| | | } |
| | | private List<MAQConditionVO_V2> getDataInit() { |
| | | List<MAQConditionVO_V2> conditionVOList = new ArrayList<>(); |
| | | conditionVOList.add(new MAQConditionVO_V2("Flexibility_1", "P_Flex01", "LIBMAQV210")); |
| | | conditionVOList.add(new MAQConditionVO_V2("Creativity_2", "P_Creat02", "LIBMAQV220")); |
| | | conditionVOList.add(new MAQConditionVO_V2("AnalyticalApproach_3", "P_Analyt03", "LIBMAQV230")); |
| | | conditionVOList.add(new MAQConditionVO_V2("Independence_4", "P_Indep04", "LIBMAQV240")); |
| | | conditionVOList.add(new MAQConditionVO_V2("AchievementOrientation_5", "P_Achiev05", "LIBMAQV250")); |
| | | conditionVOList.add(new MAQConditionVO_V2("Initiative_6", "P_Initi06", "LIBMAQV260")); |
| | | conditionVOList.add(new MAQConditionVO_V2("Persistence_7", "P_Persis07", "LIBMAQV270")); |
| | | conditionVOList.add(new MAQConditionVO_V2("Thoroughness_8", "P_Thorou08", "LIBMAQV280")); |
| | | conditionVOList.add(new MAQConditionVO_V2("Dependability_9", "P_Depend09", "LIBMAQV290")); |
| | | conditionVOList.add(new MAQConditionVO_V2("PlanningandOrganizing_10", "P_Plan10", "LIBMAQV2100")); |
| | | conditionVOList.add(new MAQConditionVO_V2("TrustandIntegrity_11", "P_Integr11", "LIBMAQV2110")); |
| | | conditionVOList.add(new MAQConditionVO_V2("PersonalEnergy_12", "P_Energy12", "LIBMAQV2120")); |
| | | conditionVOList.add(new MAQConditionVO_V2("SociallyOpen_13", "P_Social13", "LIBMAQV2130")); |
| | | conditionVOList.add(new MAQConditionVO_V2("LeadingOthers_14", "P_Lead14", "LIBMAQV2140")); |
| | | conditionVOList.add(new MAQConditionVO_V2("Influencing_15", "P_Influ15", "LIBMAQV2150")); |
| | | conditionVOList.add(new MAQConditionVO_V2("CooperationTeamwork_16", "P_Team16", "LIBMAQV2160")); |
| | | conditionVOList.add(new MAQConditionVO_V2("Empathetic_17", "P_Empath17", "LIBMAQV2170")); |
| | | conditionVOList.add(new MAQConditionVO_V2("PoliteTactful_18", "P_Polite18", "LIBMAQV2180")); |
| | | conditionVOList.add(new MAQConditionVO_V2("Self_Regulation_19", "P_Regula19", "LIBMAQV2190")); |
| | | conditionVOList.add(new MAQConditionVO_V2("ManagingStress_20", "P_ManStr20", "LIBMAQV2200")); |
| | | conditionVOList.add(new MAQConditionVO_V2("Self_Confidence_21", "P_Confid21", "LIBMAQV2210")); |
| | | conditionVOList.add(new MAQConditionVO_V2("Mindfulness_22", "P_Mind22", "LIBMAQV2220")); |
| | | conditionVOList.add(new MAQConditionVO_V2("Task_Result_Orientation_31", "P_Task31", "LIBMAQV2310")); |
| | | conditionVOList.add(new MAQConditionVO_V2("People_Orientation_32", "P_People32", "LIBMAQV2320")); |
| | | return conditionVOList; |
| | | } |
| | | |
| | | public ReportResultData getTemplateParameters(Map<String, String> thaiCalculationMap, ReportTypeEnum type, LangTypeEnum langType) { |
| | | this.reportTypeEnum = type; |
| | | this.langType = langType; |
| | | |
| | | Map textMap = new HashMap(); |
| | | Map waterDropsMap = new HashMap(); |
| | | textMap.put("questionnaireTaker", getQuestionnaireTaker()); |
| | | textMap.put("questionnaireID", getQuestionnaireID()); |
| | | textMap.put("reportGenerationDate", getReportGenerationDate()); |
| | | textMap.put("userName", getUserName()); |
| | | textMap.put("questionnaireEmail", getQuestionnaireEmail()); |
| | | textMap.put("questionnaireStartTime", getQuestionnaireStartTime()); |
| | | textMap.put("questionnaireEndTime", getQuestionnaireEndTime()); |
| | | |
| | | getParamList(type).stream().forEach(p -> { |
| | | TLibraryCode calculate = p.calculate(thaiCalculationMap, langType); |
| | | List<TLibraryCode> tLibraryCodes = p.calculateList(thaiCalculationMap, langType); |
| | | if(tLibraryCodes != null && tLibraryCodes.size() > 0){ |
| | | for (int i = 0; i < tLibraryCodes.size(); i++) { |
| | | TLibraryCode tLibraryCode = tLibraryCodes.get(i); |
| | | textMap.put(p.getName() + "_" + i, Objects.isNull(tLibraryCode) || StringUtils.isBlank(tLibraryCode.getLangTypeContext(langType)) ? "N/A NONE" : tLibraryCode.getLangTypeContext(langType)); |
| | | } |
| | | }else{ |
| | | textMap.put(p.getName(), Objects.isNull(calculate) || StringUtils.isBlank(calculate.getLangTypeContext(langType)) ? "N/A NONE" : calculate.getLangTypeContext(langType)); |
| | | } |
| | | if (Objects.nonNull(p.getMAQwaterDropsImages())) { |
| | | waterDropsMap.putAll(p.getMAQwaterDropsImages()); |
| | | } |
| | | }); |
| | | textMap.putAll(thaiCalculationMap); |
| | | ReportResultData reportResultData = new ReportResultData(); |
| | | reportResultData.setTextMap(textMap); |
| | | reportResultData.setImageMap(waterDropsMap); |
| | | return reportResultData; |
| | | } |
| | | } |
New file |
| | |
| | | package com.ots.project.tool.report.MAQNEW.base; |
| | | import com.ots.common.enums.LangTypeEnum; |
| | | import com.ots.project.exam.domain.TLibraryCode; |
| | | import com.ots.project.tool.CacheServiceFactory; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import java.util.*; |
| | | @Slf4j |
| | | public abstract class BaseCondition_V2 { |
| | | public static final String IMAGE_PREFIX = "_waterDrops"; |
| | | public abstract String getName(); |
| | | |
| | | public abstract TLibraryCode calculate(Map<String, String> map, LangTypeEnum langType); |
| | | public List<TLibraryCode> calculateList(Map<String, String> map, LangTypeEnum langType){ |
| | | return null; |
| | | } |
| | | |
| | | public abstract Map<String, String> getMAQwaterDropsImages(); |
| | | protected String selectTrueObject(Map<Boolean, String> calculateMap) { |
| | | for (Map.Entry<Boolean, String> entry : calculateMap.entrySet()) { |
| | | Boolean mapKey = entry.getKey(); |
| | | if (mapKey) { |
| | | return entry.getValue(); |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | protected boolean checkParamsNonNull(String... value) { |
| | | return !checkParamsIsNull(value); |
| | | } |
| | | protected boolean checkParamsIsNull(String... value) { |
| | | for (int i = 0; i < value.length; i++) { |
| | | if (Objects.isNull(value[i])) { |
| | | return true; |
| | | } |
| | | } |
| | | return false; |
| | | } |
| | | public TLibraryCode getMaqReportLibrary(Map<String, String> map, String codeId, LangTypeEnum langType) { |
| | | if (Objects.isNull(codeId)) { |
| | | return null; |
| | | } |
| | | StringBuilder content = new StringBuilder(); |
| | | String[] split = codeId.split(","); |
| | | TLibraryCode result = new TLibraryCode(); |
| | | Arrays.stream(split).forEach(item -> { |
| | | TLibraryCode maqReportLibrary = CacheServiceFactory.getInstance().getMAQReportLibrary(item); |
| | | if (Objects.isNull(maqReportLibrary)) { |
| | | log.warn("************** LibraryCode 没有配置 code = {} ***********", item); |
| | | } else { |
| | | content.append(maqReportLibrary.getLangTypeContext(langType)); |
| | | result.setDictType(maqReportLibrary.getDictType()); |
| | | result.setIcon(maqReportLibrary.getIcon()); |
| | | result.setLibraryCode(maqReportLibrary.getLibraryCode()); |
| | | } |
| | | }); |
| | | result.setLangTypeContext(content.toString(), langType); |
| | | dynamicParameterSubstitution(map, result, langType); |
| | | return result; |
| | | } |
| | | public void dynamicParameterSubstitution(Map<String, String> map, TLibraryCode maqReportLibrary, LangTypeEnum langType) { |
| | | map.forEach((key, value) -> { |
| | | String content = maqReportLibrary.getLangTypeContext(langType); |
| | | String replaceStr = "%" + key + "%"; |
| | | maqReportLibrary.setLangTypeContext(content.replace(replaceStr, "<BoldText>" + value + "</BoldText>"), langType); |
| | | }); |
| | | } |
| | | } |
New file |
| | |
| | | package com.ots.project.tool.report.MAQNEW.base; |
| | | import com.ots.project.tool.report.MAQ.base.MAQConditionVO; |
| | | import lombok.Getter; |
| | | import lombok.Setter; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | @Getter |
| | | @Setter |
| | | public class MAQConditionVO_V2 extends MAQConditionVO { |
| | | private boolean testHead = false; |
| | | |
| | | public MAQConditionVO_V2(String name, String conditionKey, String conditionTargetPrefix) { |
| | | this.name = name; |
| | | init(conditionKey, conditionTargetPrefix); |
| | | } |
| | | |
| | | public MAQConditionVO_V2(String name, String title, String conditionKey, String conditionTargetPrefix) { |
| | | this.name = name; |
| | | this.title = title; |
| | | this.testHead = true; |
| | | init(conditionKey, conditionTargetPrefix); |
| | | } |
| | | private void init(String conditionKey, String conditionTargetPrefix) { |
| | | setConditionKey(conditionKey); |
| | | |
| | | List<String> collect = Arrays.asList("1", "2", "3", "4", "5", "6").stream().map(item -> { |
| | | String target = conditionTargetPrefix + item; |
| | | return target; |
| | | }).collect(Collectors.toList()); |
| | | |
| | | List<String> result = collect.stream().map(p -> { |
| | | return ("P_Task31".equals(conditionKey) || "P_People32".equals(conditionKey) || testHead) ? p + "1," + p + "2" : "LIBMAQV21009," + p + "1," + p + "2"; |
| | | }).collect(Collectors.toList()); |
| | | setConditionTarget(result); |
| | | } |
| | | } |
New file |
| | |
| | | package com.ots.project.tool.report.MAQNEW.base; |
| | | import com.ots.common.enums.LangTypeEnum; |
| | | import com.ots.project.exam.domain.TLibraryCode; |
| | | import com.ots.project.tool.report.MAQ.base.MAQConditionVO; |
| | | import lombok.Getter; |
| | | import lombok.Setter; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import java.util.*; |
| | | import static com.ots.common.enums.LangTypeEnum.*; |
| | | @Setter |
| | | @Getter |
| | | @Slf4j |
| | | public class MAQSummaryCondition_V2 extends BaseCondition_V2 { |
| | | private String name; |
| | | private MAQConditionVO conditionVO; |
| | | private Double conditionValue; |
| | | public MAQSummaryCondition_V2(MAQConditionVO conditionVO) { |
| | | this.name = conditionVO.getName(); |
| | | this.conditionVO = conditionVO; |
| | | } |
| | | @Override |
| | | public Map<String, String> getMAQwaterDropsImages() { |
| | | HashMap<String, String> map = new HashMap<>(); |
| | | map.put(name + IMAGE_PREFIX, Objects.isNull(conditionValue) ? "0" : String.valueOf(conditionValue)); |
| | | return map; |
| | | } |
| | | @Override |
| | | public TLibraryCode calculate(Map<String, String> map, LangTypeEnum langType) { |
| | | try { |
| | | String conditionKey = conditionVO.getConditionKey(); |
| | | String conValue = map.get(conditionKey); |
| | | if (checkParamsIsNull(conValue)) { |
| | | return null; |
| | | } |
| | | conditionValue = Double.valueOf(conValue); |
| | | List<String> conditionTarget = conditionVO.getConditionTarget(); |
| | | boolean jianjian = conditionValue <= 5; |
| | | boolean jian = 5 < conditionValue && conditionValue <= 30; |
| | | boolean jia = 70 <= conditionValue && conditionValue < 95; |
| | | boolean jiajia = conditionValue >= 95; |
| | | String prefix = getPrefix(jianjian, jian, jia, jiajia); |
| | | if (Objects.isNull(prefix)) { |
| | | return null; |
| | | } |
| | | Map calculateMap = new HashMap(); |
| | | calculateMap.put(jianjian, conditionTarget.get(0)); |
| | | calculateMap.put(jian, conditionTarget.get(1)); |
| | | calculateMap.put(jia, conditionTarget.get(4)); |
| | | calculateMap.put(jiajia, conditionTarget.get(5)); |
| | | String codeId = selectTrueObject(calculateMap); |
| | | |
| | | TLibraryCode library = getMaqReportLibrary(map, codeId, langType); |
| | | |
| | | String split = getTitleByLang(conditionVO.getTitle(), langType); |
| | | String context = "<BoldText>" + prefix + split + "</BoldText> " + library.getLangTypeContext(langType); |
| | | library.setLangTypeContext(context, langType); |
| | | return library; |
| | | } catch (Exception ex) { |
| | | log.error("MAQCondition error name={},conditionKey={},conditionTarget={} error:{}", name, conditionVO.getConditionKey(), conditionVO.getConditionTarget(), ex.getMessage(), ex); |
| | | return null; |
| | | } |
| | | } |
| | | @Override |
| | | public List<TLibraryCode> calculateList(Map<String, String> map, LangTypeEnum langType) { |
| | | try { |
| | | String conditionKey = conditionVO.getConditionKey(); |
| | | String conValue = map.get(conditionKey); |
| | | if (checkParamsIsNull(conValue)) { |
| | | return null; |
| | | } |
| | | conditionValue = Double.valueOf(conValue); |
| | | List<String> conditionTarget = conditionVO.getConditionTarget(); |
| | | boolean jianjian = conditionValue <= 5; |
| | | boolean jian = 5 < conditionValue && conditionValue <= 30; |
| | | boolean jia = 70 <= conditionValue && conditionValue < 95; |
| | | boolean jiajia = conditionValue >= 95; |
| | | String prefix = getPrefix(jianjian, jian, jia, jiajia); |
| | | if (Objects.isNull(prefix)) { |
| | | return null; |
| | | } |
| | | Map calculateMap = new HashMap(); |
| | | calculateMap.put(jianjian, conditionTarget.get(0)); |
| | | calculateMap.put(jian, conditionTarget.get(1)); |
| | | calculateMap.put(jia, conditionTarget.get(4)); |
| | | calculateMap.put(jiajia, conditionTarget.get(5)); |
| | | String codeId = selectTrueObject(calculateMap); |
| | | String[] codes = codeId.split(","); |
| | | List<TLibraryCode> libcodes = new ArrayList<>(); |
| | | Arrays.stream(codes).forEach(item -> { |
| | | libcodes.add(getMaqReportLibrary(map, item, langType)); |
| | | }); |
| | | TLibraryCode headLib = new TLibraryCode(); |
| | | |
| | | String split = getTitleByLang(conditionVO.getTitle(), langType); |
| | | String context = "<BoldText>" + prefix + split + "</BoldText> "; |
| | | headLib.setLibraryCode("0"); |
| | | headLib.setLangTypeContext(context, langType); |
| | | headLib.setScore(conValue); |
| | | libcodes.add(headLib); |
| | | libcodes.sort(new Comparator<TLibraryCode>() { |
| | | @Override |
| | | public int compare(TLibraryCode o1, TLibraryCode o2) { |
| | | return o1.getLibraryCode().compareTo(o2.getLibraryCode()); |
| | | } |
| | | }); |
| | | return libcodes; |
| | | } catch (Exception ex) { |
| | | log.error("MAQCondition error name={},conditionKey={},conditionTarget={} error:{}", name, conditionVO.getConditionKey(), conditionVO.getConditionTarget(), ex.getMessage(), ex); |
| | | return null; |
| | | } |
| | | } |
| | | private String getTitleByLang(String title, LangTypeEnum langType) { |
| | | String[] split = title.split(","); |
| | | if (langType == English) { |
| | | return split[0]; |
| | | } else if (langType == Chinese) { |
| | | return split[1]; |
| | | } |
| | | return "noConfiguration"; |
| | | } |
| | | private String getPrefix(boolean jianjian, boolean jian, boolean jia, boolean jiajia) { |
| | | String prefix = ""; |
| | | if (jianjian) { |
| | | prefix = "--"; |
| | | } else if (jian) { |
| | | prefix = "-"; |
| | | } else if (jia) { |
| | | prefix = "+"; |
| | | } else if (jiajia) { |
| | | prefix = "++"; |
| | | } else { |
| | | prefix = null; |
| | | } |
| | | return prefix; |
| | | } |
| | | } |
New file |
| | |
| | | package com.ots.project.tool.report.MAQNEW.condition; |
| | | import com.ots.common.enums.LangTypeEnum; |
| | | import com.ots.common.utils.StringUtils; |
| | | import com.ots.project.exam.domain.TLibraryCode; |
| | | import com.ots.project.tool.CacheServiceFactory; |
| | | import com.ots.project.tool.report.MAQNEW.base.BaseCondition_V2; |
| | | import lombok.Getter; |
| | | import lombok.Setter; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | import java.util.Objects; |
| | | import static com.ots.common.enums.LangTypeEnum.*; |
| | | |
| | | @Getter |
| | | @Setter |
| | | @Slf4j |
| | | public class KeyPointsCautions_V2 extends BaseCondition_V2 { |
| | | private String name = "KeyPointsCautions_V2"; |
| | | public TLibraryCode calculate(Map<String, String> map, LangTypeEnum langType) { |
| | | try { |
| | | Map<String, String> paramMap = new HashMap(); |
| | | paramMap.put("LIBMAQV21010,LIBMAQV21025", map.get("P_Flex01")); |
| | | paramMap.put("LIBMAQV22010,LIBMAQV22025", map.get("P_Creat02")); |
| | | paramMap.put("LIBMAQV23010,LIBMAQV23025", map.get("P_Analyt03")); |
| | | paramMap.put("LIBMAQV210010,LIBMAQV210025", map.get("P_Plan10")); |
| | | paramMap.put("LIBMAQV216010,LIBMAQV216025", map.get("P_Team16")); |
| | | paramMap.put("LIBMAQV221010,LIBMAQV221025", map.get("P_Confid21")); |
| | | paramMap.put("LIBMAQV215010,LIBMAQV215025", map.get("P_Influ15")); |
| | | Map<String, Boolean> calculateMap = new HashMap(); |
| | | for (Map.Entry<String, String> entry : paramMap.entrySet()) { |
| | | if (checkParamsNonNull(entry.getValue()) && Double.valueOf(entry.getValue()) <= 30) { |
| | | calculateMap.put(entry.getKey(), true); |
| | | } |
| | | } |
| | | if (calculateMap.isEmpty()) { |
| | | calculateMap.put("LIBMAQV233054", true); |
| | | } |
| | | TLibraryCode maqReportLibrary = spliceTrueObject(calculateMap, map, langType); |
| | | return maqReportLibrary; |
| | | } catch (Exception ex) { |
| | | log.error("KeyPointsCautions error:{}", ex.getMessage(), ex); |
| | | return null; |
| | | } |
| | | } |
| | | @Override |
| | | public Map<String, String> getMAQwaterDropsImages() { |
| | | return null; |
| | | } |
| | | protected TLibraryCode spliceTrueObject(Map<String, Boolean> calculateMap, Map<String, String> map, LangTypeEnum langType) { |
| | | TLibraryCode result = new TLibraryCode(); |
| | | StringBuilder context = new StringBuilder(); |
| | | for (Map.Entry<String, Boolean> entry : calculateMap.entrySet()) { |
| | | Boolean value = entry.getValue(); |
| | | if (value) { |
| | | String key = entry.getKey(); |
| | | TLibraryCode ret = getMaqReportLibrary2(map, key, langType); |
| | | context.append(ret.getLangTypeContext(langType)); |
| | | context.append("%line-feed%"); |
| | | } |
| | | } |
| | | result.setLangTypeContext(context.toString(), langType); |
| | | if (StringUtils.isBlank(context)) { |
| | | if (langType == English) { |
| | | context.append("No caution was found."); |
| | | } else if (langType == Chinese) { |
| | | context.append("没有发现短版项。"); |
| | | } else if (langType == Thai) { |
| | | context.append("No caution was found."); |
| | | } |
| | | result.setLangTypeContext(context.toString(), langType); |
| | | } |
| | | return result; |
| | | } |
| | | public TLibraryCode getMaqReportLibrary2(Map<String, String> map, String codeId, LangTypeEnum langType) { |
| | | StringBuilder content = new StringBuilder(); |
| | | String[] split = codeId.split(","); |
| | | for (int i = 0; i < split.length; i++) { |
| | | TLibraryCode maqReportLibrary = CacheServiceFactory.getInstance().getMAQReportLibrary(split[i]); |
| | | if (Objects.isNull(maqReportLibrary)) { |
| | | log.error("************** LibraryCode 没有配置 code = {} ***********", split[i]); |
| | | } else { |
| | | if (i == 0) { |
| | | content.append("<BoldText>"); |
| | | content.append("<YellowText>"); |
| | | content.append(maqReportLibrary.getLangTypeContext(langType)); |
| | | content.append("</YellowText>"); |
| | | content.append("</BoldText>"); |
| | | } else { |
| | | content.append(maqReportLibrary.getLangTypeContext(langType)); |
| | | } |
| | | } |
| | | } |
| | | TLibraryCode result = new TLibraryCode(); |
| | | result.setLangTypeContext(content.toString(), langType); |
| | | dynamicParameterSubstitution2(map, result, langType); |
| | | return result; |
| | | } |
| | | public void dynamicParameterSubstitution2(Map<String, String> map, TLibraryCode maqReportLibrary, LangTypeEnum langType) { |
| | | map.forEach((key, value) -> { |
| | | String content = maqReportLibrary.getLangTypeContext(langType); |
| | | String replaceStr = "%" + key + "%"; |
| | | maqReportLibrary.setLangTypeContext(content.replace(replaceStr, value), langType); |
| | | }); |
| | | } |
| | | } |
New file |
| | |
| | | package com.ots.project.tool.report.MAQNEW.condition; |
| | | import com.ots.common.enums.LangTypeEnum; |
| | | import com.ots.common.utils.StringUtils; |
| | | import com.ots.project.exam.domain.TLibraryCode; |
| | | import com.ots.project.tool.CacheServiceFactory; |
| | | import com.ots.project.tool.report.MAQNEW.base.BaseCondition_V2; |
| | | import lombok.Getter; |
| | | import lombok.Setter; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | import java.util.Objects; |
| | | import static com.ots.common.enums.LangTypeEnum.*; |
| | | |
| | | @Getter |
| | | @Setter |
| | | @Slf4j |
| | | public class KeyPointsStrengths_V2 extends BaseCondition_V2 { |
| | | private String name = "KeyPointsStrengths_V2"; |
| | | public TLibraryCode calculate(Map<String, String> map, LangTypeEnum langType) { |
| | | try { |
| | | Map<String, String> paramMap = new HashMap(); |
| | | paramMap.put("LIBMAQV21010,LIBMAQV21055", map.get("P_Flex01")); |
| | | paramMap.put("LIBMAQV22010,LIBMAQV22055", map.get("P_Creat02")); |
| | | paramMap.put("LIBMAQV23010,LIBMAQV23055", map.get("P_Analyt03")); |
| | | paramMap.put("LIBMAQV210010,LIBMAQV210055", map.get("P_Plan10")); |
| | | paramMap.put("LIBMAQV216010,LIBMAQV216055", map.get("P_Team16")); |
| | | paramMap.put("LIBMAQV221010,LIBMAQV221055", map.get("P_Confid21")); |
| | | paramMap.put("LIBMAQV215010,LIBMAQV215055", map.get("P_Influ15")); |
| | | Map<String, Boolean> calculateMap = new HashMap(); |
| | | for (Map.Entry<String, String> entry : paramMap.entrySet()) { |
| | | if (checkParamsNonNull(entry.getValue()) && Double.valueOf(entry.getValue()) >= 70) { |
| | | calculateMap.put(entry.getKey(), true); |
| | | } |
| | | } |
| | | if (calculateMap.isEmpty()) { |
| | | calculateMap.put("LIBMAQV233052", true); |
| | | } |
| | | TLibraryCode maqReportLibrary = spliceTrueObject(calculateMap, map, langType); |
| | | return maqReportLibrary; |
| | | } catch (Exception ex) { |
| | | log.error("KeyPointsStrengths error:{}", ex.getMessage(), ex); |
| | | return null; |
| | | } |
| | | } |
| | | @Override |
| | | public Map<String, String> getMAQwaterDropsImages() { |
| | | return null; |
| | | } |
| | | protected TLibraryCode spliceTrueObject(Map<String, Boolean> calculateMap, Map<String, String> map, LangTypeEnum langType) { |
| | | TLibraryCode result = new TLibraryCode(); |
| | | StringBuilder context = new StringBuilder(); |
| | | for (Map.Entry<String, Boolean> entry : calculateMap.entrySet()) { |
| | | Boolean value = entry.getValue(); |
| | | if (value) { |
| | | TLibraryCode ret = getMaqReportLibrary2(map, entry.getKey(), langType); |
| | | context.append(ret.getLangTypeContext(langType)); |
| | | context.append("%line-feed%"); |
| | | } |
| | | } |
| | | result.setLangTypeContext(context.toString(), langType); |
| | | if (StringUtils.isBlank(context)) { |
| | | if (langType == English) { |
| | | context.append("No caution was found."); |
| | | } else if (langType == Chinese) { |
| | | context.append("没有发现优势项。"); |
| | | } else if (langType == Thai) { |
| | | context.append("No caution was found."); |
| | | } |
| | | result.setLangTypeContext(context.toString(), langType); |
| | | } |
| | | return result; |
| | | } |
| | | public TLibraryCode getMaqReportLibrary2(Map<String, String> map, String codeId, LangTypeEnum langType) { |
| | | StringBuilder content = new StringBuilder(); |
| | | String[] split = codeId.split(","); |
| | | for (int i = 0; i < split.length; i++) { |
| | | TLibraryCode maqReportLibrary = CacheServiceFactory.getInstance().getMAQReportLibrary(split[i]); |
| | | if (Objects.isNull(maqReportLibrary)) { |
| | | log.error("************** LibraryCode 没有配置 code = {} ***********", split[i]); |
| | | } else { |
| | | if (i == 0) { |
| | | content.append("<BoldText>"); |
| | | content.append("<YellowText>"); |
| | | content.append(maqReportLibrary.getLangTypeContext(langType)); |
| | | content.append("</YellowText>"); |
| | | content.append("</BoldText>"); |
| | | } else { |
| | | content.append(maqReportLibrary.getLangTypeContext(langType)); |
| | | } |
| | | } |
| | | } |
| | | TLibraryCode result = new TLibraryCode(); |
| | | result.setLangTypeContext(content.toString(), langType); |
| | | dynamicParameterSubstitution2(map, result, langType); |
| | | return result; |
| | | } |
| | | public void dynamicParameterSubstitution2(Map<String, String> map, TLibraryCode maqReportLibrary, LangTypeEnum langType) { |
| | | map.forEach((key, value) -> { |
| | | String content = maqReportLibrary.getLangTypeContext(langType); |
| | | String replaceStr = "%" + key + "%"; |
| | | maqReportLibrary.setLangTypeContext(content.replace(replaceStr, value), langType); |
| | | }); |
| | | } |
| | | } |
New file |
| | |
| | | package com.ots.project.tool.report.MAQNEW.condition; |
| | | import com.ots.common.enums.LangTypeEnum; |
| | | import com.ots.project.exam.domain.TLibraryCode; |
| | | import com.ots.project.tool.CacheServiceFactory; |
| | | import com.ots.project.tool.report.MAQ.base.MAQConditionVO; |
| | | import com.ots.project.tool.report.MAQNEW.base.BaseCondition_V2; |
| | | import lombok.Getter; |
| | | import lombok.Setter; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import java.util.*; |
| | | @Setter |
| | | @Getter |
| | | @Slf4j |
| | | public class MAQCondition_V2 extends BaseCondition_V2 { |
| | | private String name; |
| | | private MAQConditionVO conditionVO; |
| | | private Double conditionValue; |
| | | public MAQCondition_V2(MAQConditionVO conditionVO) { |
| | | this.name = conditionVO.getName(); |
| | | this.conditionVO = conditionVO; |
| | | } |
| | | public static void main(String[] args) { |
| | | String core = "LIBMAQ1011"; |
| | | String[] split = core.split(","); |
| | | System.out.println(split.length); |
| | | } |
| | | @Override |
| | | public Map<String, String> getMAQwaterDropsImages() { |
| | | HashMap<String, String> map = new HashMap<>(); |
| | | map.put(name + IMAGE_PREFIX, Objects.isNull(conditionValue) ? "0" : String.valueOf(conditionValue)); |
| | | return map; |
| | | } |
| | | @Override |
| | | public TLibraryCode calculate(Map<String, String> map, LangTypeEnum langType) { |
| | | try { |
| | | String conditionKey = conditionVO.getConditionKey(); |
| | | String conValue = map.get(conditionKey); |
| | | if (checkParamsIsNull(conValue)) { |
| | | return null; |
| | | } |
| | | conditionValue = Double.valueOf(conValue); |
| | | List<String> conditionTarget = conditionVO.getConditionTarget(); |
| | | Map calculateMap = new HashMap(); |
| | | calculateMap.put(conditionValue <= 5, conditionTarget.get(0)); |
| | | calculateMap.put(5 < conditionValue && conditionValue <= 30, conditionTarget.get(1)); |
| | | calculateMap.put(30 < conditionValue && conditionValue < 50, conditionTarget.get(2)); |
| | | calculateMap.put(50 <= conditionValue && conditionValue < 70, conditionTarget.get(3)); |
| | | calculateMap.put(70 <= conditionValue && conditionValue < 95, conditionTarget.get(4)); |
| | | calculateMap.put(conditionValue >= 95, conditionTarget.get(5)); |
| | | String codeId = selectTrueObject(calculateMap); |
| | | |
| | | TLibraryCode library = getMaqReportLibrary(map, codeId, langType); |
| | | return library; |
| | | } catch (Exception ex) { |
| | | log.error("MAQCondition error name={},conditionKey={},conditionTarget={} error:{}", name, conditionVO.getConditionKey(), conditionVO.getConditionTarget(), ex.getMessage(), ex); |
| | | return null; |
| | | } |
| | | } |
| | | @Override |
| | | public List<TLibraryCode> calculateList(Map<String, String> map, LangTypeEnum langType) { |
| | | try { |
| | | String conditionKey = conditionVO.getConditionKey(); |
| | | String conValue = map.get(conditionKey); |
| | | if (checkParamsIsNull(conValue)) { |
| | | return null; |
| | | } |
| | | conditionValue = Double.valueOf(conValue); |
| | | List<String> conditionTarget = conditionVO.getConditionTarget(); |
| | | Map calculateMap = new HashMap(); |
| | | calculateMap.put(conditionValue <= 5, conditionTarget.get(0)); |
| | | calculateMap.put(5 < conditionValue && conditionValue <= 30, conditionTarget.get(1)); |
| | | calculateMap.put(30 < conditionValue && conditionValue < 50, conditionTarget.get(2)); |
| | | calculateMap.put(50 <= conditionValue && conditionValue < 70, conditionTarget.get(3)); |
| | | calculateMap.put(70 <= conditionValue && conditionValue < 95, conditionTarget.get(4)); |
| | | calculateMap.put(conditionValue >= 95, conditionTarget.get(5)); |
| | | String codeId = selectTrueObject(calculateMap); |
| | | String[] split = codeId.split(","); |
| | | List<TLibraryCode> libcodes = new ArrayList<>(); |
| | | Arrays.stream(split).forEach(item -> { |
| | | libcodes.add(getMaqReportLibrary(map, item, langType)); |
| | | }); |
| | | return libcodes; |
| | | } catch (Exception ex) { |
| | | log.error("MAQCondition error name={},conditionKey={},conditionTarget={} error:{}", name, conditionVO.getConditionKey(), conditionVO.getConditionTarget(), ex.getMessage(), ex); |
| | | return null; |
| | | } |
| | | } |
| | | } |
New file |
| | |
| | | package com.ots.project.tool.report.MAQNEW.condition; |
| | | import com.ots.common.enums.LangTypeEnum; |
| | | import com.ots.common.utils.StringUtils; |
| | | import com.ots.project.exam.domain.TLibraryCode; |
| | | import com.ots.project.tool.report.MAQNEW.base.BaseCondition_V2; |
| | | import com.ots.project.tool.report.MAQNEW.base.MAQSummaryCondition_V2; |
| | | import lombok.Getter; |
| | | import lombok.Setter; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import java.util.*; |
| | | import static com.ots.common.enums.LangTypeEnum.*; |
| | | |
| | | @Setter |
| | | @Getter |
| | | @Slf4j |
| | | public class MAQSummary_V2 extends BaseCondition_V2 { |
| | | private final List<MAQSummaryCondition_V2> paramList; |
| | | private String name; |
| | | public MAQSummary_V2(String name, List<MAQSummaryCondition_V2> paramList) { |
| | | this.name = name; |
| | | this.paramList = paramList; |
| | | } |
| | | @Override |
| | | public TLibraryCode calculate(Map<String, String> map, LangTypeEnum langType) { |
| | | if (Objects.isNull(paramList) || paramList.isEmpty()) { |
| | | return null; |
| | | } |
| | | StringBuffer context = new StringBuffer(); |
| | | paramList.stream().forEach(item -> { |
| | | TLibraryCode calculate = item.calculate(map, langType); |
| | | if (Objects.nonNull(calculate)) { |
| | | context.append(calculate.getLangTypeContext(langType)); |
| | | context.append("%line-feed%"); |
| | | } |
| | | }); |
| | | TLibraryCode maqReportLibrary = new TLibraryCode(); |
| | | if (StringUtils.isBlank(context)) { |
| | | if (langType == English) { |
| | | context.append("Mid-range on all these scales.Implications Notes: No strength and weakness was found."); |
| | | } else if (langType == Chinese) { |
| | | context.append("所有维度的分数都在中等范围,没有高分和低分项。"); |
| | | } else if (langType == Thai) { |
| | | context.append("Mid-range on all these scales.Implications Notes: No strength and weakness was found."); |
| | | } |
| | | } |
| | | maqReportLibrary.setLangTypeContext(context.toString(), langType); |
| | | return maqReportLibrary; |
| | | } |
| | | @Override |
| | | public List<TLibraryCode> calculateList(Map<String, String> map, LangTypeEnum langType) { |
| | | if (Objects.isNull(paramList) || paramList.isEmpty()) { |
| | | return null; |
| | | } |
| | | StringBuffer context = new StringBuffer(); |
| | | List<TLibraryCode> libcodes = new ArrayList<>(); |
| | | List<Map<Integer, List<TLibraryCode>>> sortList = new ArrayList<>(); |
| | | for (MAQSummaryCondition_V2 maqSummaryCondition_v2 : paramList) { |
| | | List<TLibraryCode> tLibraryCodes = maqSummaryCondition_v2.calculateList(map, langType); |
| | | if (tLibraryCodes != null && tLibraryCodes.size() > 0) { |
| | | Integer sortLevel = getSortLevel(tLibraryCodes, langType); |
| | | Map<Integer, List<TLibraryCode>> sortMap = new HashMap<>(); |
| | | sortMap.put(sortLevel, tLibraryCodes); |
| | | sortList.add(sortMap); |
| | | } |
| | | } |
| | | sortList.sort(new Comparator<Map<Integer, List<TLibraryCode>>>() { |
| | | @Override |
| | | public int compare(Map<Integer, List<TLibraryCode>> o1, Map<Integer, List<TLibraryCode>> o2) { |
| | | Integer o1_level = new ArrayList<>(o1.keySet()).get(0); |
| | | Integer o2_level = new ArrayList<>(o2.keySet()).get(0); |
| | | if(o1_level.intValue() != o2_level.intValue()){ |
| | | return o2_level - o1_level; |
| | | }else{ |
| | | List<TLibraryCode> o1_tLibraryCodes = o1.get(o1_level); |
| | | List<TLibraryCode> o2_tLibraryCodes = o2.get(o2_level); |
| | | return Integer.parseInt(o2_tLibraryCodes.get(0).getScore()) - Integer.parseInt(o1_tLibraryCodes.get(0).getScore()); |
| | | } |
| | | } |
| | | }); |
| | | for (Map<Integer, List<TLibraryCode>> integerListMap : sortList) { |
| | | for (Integer integer : integerListMap.keySet()) { |
| | | libcodes.addAll(integerListMap.get(integer)); |
| | | } |
| | | } |
| | | TLibraryCode maqReportLibrary = new TLibraryCode(); |
| | | if (libcodes.size() < 1) { |
| | | if (langType == English) { |
| | | context.append("Mid-range on all these scales.Implications Notes: No strength and weakness was found."); |
| | | } else if (langType == Chinese) { |
| | | context.append("所有维度的分数都在中等范围,没有高分和低分项。"); |
| | | } else if (langType == Thai) { |
| | | context.append("Mid-range on all these scales.Implications Notes: No strength and weakness was found."); |
| | | } |
| | | maqReportLibrary.setLangTypeContext(context.toString(), langType); |
| | | libcodes.add(maqReportLibrary); |
| | | } else { |
| | | libcodes.add(getMaqReportLibrary(map, "LIBMAQV233063", langType)); |
| | | } |
| | | return libcodes; |
| | | } |
| | | private Integer getSortLevel(List<TLibraryCode> tLibraryCodes, LangTypeEnum langType) { |
| | | TLibraryCode tLibraryCode = tLibraryCodes.get(0); |
| | | String context = getContext(tLibraryCode, langType); |
| | | int index = 1; |
| | | while (context.indexOf("-") > 0 || context.indexOf("+") > 0) { |
| | | if (context.indexOf("-") > 0) { |
| | | context = context.replaceFirst("-", ""); |
| | | index = index * 10; |
| | | } else if (context.indexOf("+") > 0) { |
| | | context = context.replaceFirst("\\+", ""); |
| | | index = index * 1000; |
| | | } |
| | | } |
| | | return index; |
| | | } |
| | | private String getContext(TLibraryCode tLibraryCode, LangTypeEnum langType) { |
| | | String context = ""; |
| | | if (langType == English) { |
| | | context = tLibraryCode.getEnglistContent(); |
| | | } else if (langType == Chinese) { |
| | | context = tLibraryCode.getChineseContent(); |
| | | } else if (langType == Thai) { |
| | | context = tLibraryCode.getThaiContent(); |
| | | } |
| | | return context; |
| | | } |
| | | @Override |
| | | public Map<String, String> getMAQwaterDropsImages() { |
| | | return null; |
| | | } |
| | | } |
New file |
| | |
| | | package com.ots.project.tool.report.MAQNEW.condition; |
| | | import com.ots.common.enums.LangTypeEnum; |
| | | import com.ots.project.exam.domain.TLibraryCode; |
| | | import com.ots.project.tool.report.MAQNEW.base.BaseCondition_V2; |
| | | import lombok.Getter; |
| | | import lombok.Setter; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | | @Getter |
| | | @Setter |
| | | @Slf4j |
| | | public class PrimaryLeadershipStyleContext_V2 extends BaseCondition_V2 { |
| | | private String name = "PrimaryLeadershipStyleContext_V2"; |
| | | public TLibraryCode calculate(Map<String, String> 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; |
| | | } |
| | | Map calculateMap = new HashMap(); |
| | | calculateMap.put(Double.valueOf(p_task31) >= 50 && Double.valueOf(p_people32) < 50, "LIBMAQV225011"); |
| | | calculateMap.put(Double.valueOf(p_task31) >= 50 && Double.valueOf(p_people32) >= 50, "LIBMAQV225021"); |
| | | calculateMap.put(Double.valueOf(p_task31) < 50 && Double.valueOf(p_people32) >= 50, "LIBMAQV225031"); |
| | | calculateMap.put(Double.valueOf(p_task31) < 50 && Double.valueOf(p_people32) < 50, "LIBMAQV225041"); |
| | | String codeId = selectTrueObject(calculateMap); |
| | | |
| | | TLibraryCode maqReportLibrary = getMaqReportLibrary(map, codeId, langType); |
| | | return maqReportLibrary; |
| | | } catch (Exception ex) { |
| | | log.error("ResponseFidelityDiagnosis error:{}", ex.getMessage(), ex); |
| | | return null; |
| | | } |
| | | } |
| | | @Override |
| | | public Map<String, String> getMAQwaterDropsImages() { |
| | | return null; |
| | | } |
| | | } |
New file |
| | |
| | | package com.ots.project.tool.report.MAQNEW.condition; |
| | | import com.ots.common.enums.LangTypeEnum; |
| | | import com.ots.project.exam.domain.TLibraryCode; |
| | | import com.ots.project.tool.report.MAQNEW.base.BaseCondition_V2; |
| | | import lombok.Getter; |
| | | import lombok.Setter; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import java.util.Map; |
| | | @Slf4j |
| | | @Getter |
| | | @Setter |
| | | public class PrimaryLeadershipStyle_V2 extends BaseCondition_V2 { |
| | | private String name = "PrimaryLeadershipStyle_V2"; |
| | | @Override |
| | | public TLibraryCode calculate(Map<String, String> 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 = "LIBMAQV225003"; |
| | | } else if (P_task31 >= 50 && P_people32 >= 50) { |
| | | codeId = "LIBMAQV225016"; |
| | | } else if (P_task31 < 50 && P_people32 >= 50) { |
| | | codeId = "LIBMAQV225026"; |
| | | } else if (P_task31 < 50 && P_people32 < 50) { |
| | | codeId = "LIBMAQV225036"; |
| | | } 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<String, String> getMAQwaterDropsImages() { |
| | | return null; |
| | | } |
| | | } |
New file |
| | |
| | | package com.ots.project.tool.report.MAQNEW.condition; |
| | | import com.ots.common.enums.LangTypeEnum; |
| | | import com.ots.project.exam.domain.TLibraryCode; |
| | | import com.ots.project.tool.report.MAQNEW.base.BaseCondition_V2; |
| | | import lombok.Getter; |
| | | import lombok.Setter; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | | @Getter |
| | | @Setter |
| | | @Slf4j |
| | | public class ResponseFidelityDiagnosisTitle_V2 extends BaseCondition_V2 { |
| | | private String name = "ResponseFidelityDiagnosisTitle_V2"; |
| | | private Double P_SDE_T1; |
| | | private Double P_IM_T1; |
| | | private Double P_INCON_T1; |
| | | @Override |
| | | public Map<String, String> getMAQwaterDropsImages() { |
| | | return null; |
| | | } |
| | | public TLibraryCode calculate(Map<String, String> map, LangTypeEnum langType) { |
| | | try { |
| | | String p_sde_t1 = map.get("P_SDE_T1"); |
| | | String p_im_t1 = map.get("P_IM_T1"); |
| | | String p_incon_t1 = map.get("P_INCON_T1"); |
| | | String p_sde23 = map.get("P_SDE23"); |
| | | String p_im24 = map.get("P_IM24"); |
| | | String p_incon25 = map.get("P_INCON25"); |
| | | if (checkParamsIsNull(p_sde_t1, p_im_t1, p_incon_t1, p_sde23, p_im24, p_incon25)) { |
| | | return null; |
| | | } |
| | | P_SDE_T1 = Double.valueOf(p_sde_t1); |
| | | P_IM_T1 = Double.valueOf(p_im_t1); |
| | | P_INCON_T1 = Double.valueOf(p_incon_t1); |
| | | Double P_SDE23 = Double.valueOf(p_sde23); |
| | | Double P_IM24 = Double.valueOf(p_im24); |
| | | Double P_INCON25 = Double.valueOf(p_incon25); |
| | | boolean LIBMAQV28801 = (P_SDE_T1 >= 95 || P_IM_T1 >= 95 || P_INCON_T1 >= 95) && (P_SDE23 >= 95 || P_IM24 >= 95 || P_INCON25 >= 95); |
| | | boolean LIBMAQV28802 = (P_SDE_T1 >= 95 || P_IM_T1 >= 95 || P_INCON_T1 >= 95) && ((5 < P_SDE23 && P_SDE23 < 95) && (5 < P_IM24 && P_IM24 < 95) && P_INCON25 < 95); |
| | | boolean LIBMAQV28803 = (P_SDE_T1 >= 95 || P_IM_T1 >= 95 || P_INCON_T1 >= 95) && (P_SDE23 <= 5 || P_IM24 <= 5) && (P_INCON25 < 95); |
| | | boolean LIBMAQV28804 = (P_SDE_T1 < 95 && P_IM_T1 < 95 && P_INCON_T1 < 95) && (P_SDE23 >= 95 || P_IM24 >= 95 || P_INCON25 >= 95); |
| | | boolean LIBMAQV28805 = (P_SDE_T1 < 95 && P_IM_T1 < 95 && P_INCON_T1 < 95) && ((5 < P_SDE23 && P_SDE23 < 95) && (5 < P_IM24 && P_IM24 < 95) && P_INCON25 < 95); |
| | | boolean LIBMAQV28806 = (P_SDE_T1 < 95 && P_IM_T1 < 95 && P_INCON_T1 < 95) && (P_SDE23 <= 5 || P_IM24 <= 5) && (P_INCON25 < 95); |
| | | Map calculateMap = new HashMap(); |
| | | calculateMap.put(LIBMAQV28801, "LIBMAQV28801"); |
| | | calculateMap.put(LIBMAQV28802, "LIBMAQV28802"); |
| | | calculateMap.put(LIBMAQV28803, "LIBMAQV28803"); |
| | | calculateMap.put(LIBMAQV28804, "LIBMAQV28804"); |
| | | calculateMap.put(LIBMAQV28805, "LIBMAQV28805"); |
| | | calculateMap.put(LIBMAQV28806, "LIBMAQV28806"); |
| | | String codeId = selectTrueObject(calculateMap); |
| | | |
| | | TLibraryCode maqReportLibrary = getMaqReportLibrary(map, codeId, langType); |
| | | return maqReportLibrary; |
| | | } catch (Exception ex) { |
| | | log.error("ResponseFidelityDiagnosis error:{}", ex.getMessage(), ex); |
| | | return null; |
| | | } |
| | | } |
| | | } |
New file |
| | |
| | | package com.ots.project.tool.report.MAQNEW.condition; |
| | | import com.ots.common.enums.LangTypeEnum; |
| | | import com.ots.project.exam.domain.TLibraryCode; |
| | | import com.ots.project.tool.report.MAQNEW.base.BaseCondition_V2; |
| | | import lombok.Getter; |
| | | import lombok.Setter; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import java.util.*; |
| | | |
| | | @Getter |
| | | @Setter |
| | | @Slf4j |
| | | public class ResponseFidelityDiagnosis_V2 extends BaseCondition_V2 { |
| | | private String name = "ResponseFidelityDiagnosis_V2"; |
| | | private Double P_SDE23; |
| | | private Double P_IM24; |
| | | private Double P_INCON25; |
| | | @Override |
| | | public Map<String, String> getMAQwaterDropsImages() { |
| | | Map map = new HashMap(); |
| | | map.put(name + IMAGE_PREFIX + "1", Objects.isNull(P_SDE23) ? "0" : String.valueOf(P_SDE23)); |
| | | map.put(name + IMAGE_PREFIX + "2", Objects.isNull(P_IM24) ? "0" : String.valueOf(P_IM24)); |
| | | map.put(name + IMAGE_PREFIX + "3", Objects.isNull(P_INCON25) ? "0" : String.valueOf(P_INCON25)); |
| | | return map; |
| | | } |
| | | public TLibraryCode calculate(Map<String, String> map, LangTypeEnum langType) { |
| | | try { |
| | | String p_sde_t1 = map.get("P_SDE_T1"); |
| | | String p_im_t1 = map.get("P_IM_T1"); |
| | | String p_incon_t1 = map.get("P_INCON_T1"); |
| | | String p_sde23 = map.get("P_SDE23"); |
| | | String p_im24 = map.get("P_IM24"); |
| | | String p_incon25 = map.get("P_INCON25"); |
| | | if (checkParamsIsNull(p_sde_t1, p_im_t1, p_incon_t1, p_sde23, p_im24, p_incon25)) { |
| | | return null; |
| | | } |
| | | Double P_SDE_T1 = Double.valueOf(p_sde_t1); |
| | | Double P_IM_T1 = Double.valueOf(p_im_t1); |
| | | Double P_INCON_T1 = Double.valueOf(p_incon_t1); |
| | | P_SDE23 = Double.valueOf(p_sde23); |
| | | P_IM24 = Double.valueOf(p_im24); |
| | | P_INCON25 = Double.valueOf(p_incon25); |
| | | boolean LIBMAQV28801_3 = (P_SDE_T1 >= 95 || P_IM_T1 >= 95 || P_INCON_T1 >= 95) && (P_SDE23 >= 95 || P_IM24 >= 95 || P_INCON25 >= 95); |
| | | boolean LIBMAQV28802_3 = (P_SDE_T1 >= 95 || P_IM_T1 >= 95 || P_INCON_T1 >= 95) && ((5 < P_SDE23 && P_SDE23 < 95) && (5 < P_IM24 && P_IM24 < 95) && P_INCON25 < 95); |
| | | boolean LIBMAQV28803_3 = (P_SDE_T1 >= 95 || P_IM_T1 >= 95 || P_INCON_T1 >= 95) && (P_SDE23 <= 5 || P_IM24 <= 5) && (P_INCON25 < 95); |
| | | boolean LIBMAQV28804_3 = (P_SDE_T1 < 95 && P_IM_T1 < 95 && P_INCON_T1 < 95) && (P_SDE23 >= 95 || P_IM24 >= 95 || P_INCON25 >= 95); |
| | | boolean LIBMAQV28805_3 = (P_SDE_T1 < 95 && P_IM_T1 < 95 && P_INCON_T1 < 95) && ((5 < P_SDE23 && P_SDE23 < 95) && (5 < P_IM24 && P_IM24 < 95) && P_INCON25 < 95); |
| | | boolean LIBMAQV28806_3 = (P_SDE_T1 < 95 && P_IM_T1 < 95 && P_INCON_T1 < 95) && (P_SDE23 <= 5 || P_IM24 <= 5) && (P_INCON25 < 95); |
| | | Map calculateMap = new HashMap(); |
| | | calculateMap.put(LIBMAQV28801_3, "LIBMAQV288011,LIBMAQV288012,LIBMAQV288013"); |
| | | calculateMap.put(LIBMAQV28802_3, "LIBMAQV288021,LIBMAQV288022,LIBMAQV288023"); |
| | | calculateMap.put(LIBMAQV28803_3, "LIBMAQV288031,LIBMAQV288032,LIBMAQV288033"); |
| | | calculateMap.put(LIBMAQV28804_3, "LIBMAQV288041,LIBMAQV288042,LIBMAQV288043"); |
| | | calculateMap.put(LIBMAQV28805_3, "LIBMAQV288051,LIBMAQV288052,LIBMAQV288053"); |
| | | calculateMap.put(LIBMAQV28806_3, "LIBMAQV288061,LIBMAQV288062,LIBMAQV288063"); |
| | | String codeId = selectTrueObject(calculateMap); |
| | | |
| | | TLibraryCode maqReportLibrary = getMaqReportLibrary(map, codeId, langType); |
| | | return maqReportLibrary; |
| | | } catch (Exception ex) { |
| | | log.error("ResponseFidelityDiagnosis error:{}", ex.getMessage(), ex); |
| | | return null; |
| | | } |
| | | } |
| | | public List<TLibraryCode> calculateList(Map<String, String> map, LangTypeEnum langType) { |
| | | try { |
| | | String p_sde_t1 = map.get("P_SDE_T1"); |
| | | String p_im_t1 = map.get("P_IM_T1"); |
| | | String p_incon_t1 = map.get("P_INCON_T1"); |
| | | String p_sde23 = map.get("P_SDE23"); |
| | | String p_im24 = map.get("P_IM24"); |
| | | String p_incon25 = map.get("P_INCON25"); |
| | | if (checkParamsIsNull(p_sde_t1, p_im_t1, p_incon_t1, p_sde23, p_im24, p_incon25)) { |
| | | return null; |
| | | } |
| | | Double P_SDE_T1 = Double.valueOf(p_sde_t1); |
| | | Double P_IM_T1 = Double.valueOf(p_im_t1); |
| | | Double P_INCON_T1 = Double.valueOf(p_incon_t1); |
| | | P_SDE23 = Double.valueOf(p_sde23); |
| | | P_IM24 = Double.valueOf(p_im24); |
| | | P_INCON25 = Double.valueOf(p_incon25); |
| | | boolean LIBMAQV28801_3 = (P_SDE_T1 >= 95 || P_IM_T1 >= 95 || P_INCON_T1 >= 95) && (P_SDE23 >= 95 || P_IM24 >= 95 || P_INCON25 >= 95); |
| | | boolean LIBMAQV28802_3 = (P_SDE_T1 >= 95 || P_IM_T1 >= 95 || P_INCON_T1 >= 95) && ((5 < P_SDE23 && P_SDE23 < 95) && (5 < P_IM24 && P_IM24 < 95) && P_INCON25 < 95); |
| | | boolean LIBMAQV28803_3 = (P_SDE_T1 >= 95 || P_IM_T1 >= 95 || P_INCON_T1 >= 95) && (P_SDE23 <= 5 || P_IM24 <= 5) && (P_INCON25 < 95); |
| | | boolean LIBMAQV28804_3 = (P_SDE_T1 < 95 && P_IM_T1 < 95 && P_INCON_T1 < 95) && (P_SDE23 >= 95 || P_IM24 >= 95 || P_INCON25 >= 95); |
| | | boolean LIBMAQV28805_3 = (P_SDE_T1 < 95 && P_IM_T1 < 95 && P_INCON_T1 < 95) && ((5 < P_SDE23 && P_SDE23 < 95) && (5 < P_IM24 && P_IM24 < 95) && P_INCON25 < 95); |
| | | boolean LIBMAQV28806_3 = (P_SDE_T1 < 95 && P_IM_T1 < 95 && P_INCON_T1 < 95) && (P_SDE23 <= 5 || P_IM24 <= 5) && (P_INCON25 < 95); |
| | | Map calculateMap = new HashMap(); |
| | | calculateMap.put(LIBMAQV28801_3, "LIBMAQV288011,LIBMAQV288012,LIBMAQV288013"); |
| | | calculateMap.put(LIBMAQV28802_3, "LIBMAQV288021,LIBMAQV288022,LIBMAQV288023"); |
| | | calculateMap.put(LIBMAQV28803_3, "LIBMAQV288031,LIBMAQV288032,LIBMAQV288033"); |
| | | calculateMap.put(LIBMAQV28804_3, "LIBMAQV288041,LIBMAQV288042,LIBMAQV288043"); |
| | | calculateMap.put(LIBMAQV28805_3, "LIBMAQV288051,LIBMAQV288052,LIBMAQV288053"); |
| | | calculateMap.put(LIBMAQV28806_3, "LIBMAQV288061,LIBMAQV288062,LIBMAQV288063"); |
| | | String codeId = selectTrueObject(calculateMap); |
| | | String[] split = codeId.split(","); |
| | | List<TLibraryCode> libcodes = new ArrayList<>(); |
| | | Arrays.stream(split).forEach(item -> { |
| | | libcodes.add(getMaqReportLibrary(map, item, langType)); |
| | | }); |
| | | return libcodes; |
| | | } catch (Exception ex) { |
| | | log.error("ResponseFidelityDiagnosis error:{}", ex.getMessage(), ex); |
| | | return null; |
| | | } |
| | | } |
| | | } |
New file |
| | |
| | | package com.ots.project.tool.report.MAQNEW.condition; |
| | | import com.ots.common.enums.LangTypeEnum; |
| | | import com.ots.project.exam.domain.TLibraryCode; |
| | | import com.ots.project.tool.report.MAQNEW.base.BaseCondition_V2; |
| | | import lombok.Getter; |
| | | import lombok.Setter; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import java.util.Map; |
| | | @Setter |
| | | @Getter |
| | | @Slf4j |
| | | public class ScoreCharacteristics_V2 extends BaseCondition_V2 { |
| | | private final String conditionKey; |
| | | private Double conditionValue; |
| | | private String name; |
| | | public ScoreCharacteristics_V2(String conditionKey) { |
| | | this.conditionKey = conditionKey; |
| | | } |
| | | @Override |
| | | public TLibraryCode calculate(Map<String, String> map, LangTypeEnum langType) { |
| | | String keyValue = map.get(conditionKey); |
| | | if (checkParamsIsNull(keyValue)) { |
| | | return null; |
| | | } |
| | | conditionValue = Double.valueOf(keyValue); |
| | | if (conditionValue <= 5) { |
| | | name = conditionKey + "_XX1"; |
| | | } else if (6 <= conditionValue && conditionValue <= 30) { |
| | | name = conditionKey + "_XX2"; |
| | | } else if (31 <= conditionValue && conditionValue <= 49) { |
| | | name = conditionKey + "_XX3"; |
| | | } else if (50 <= conditionValue && conditionValue <= 69) { |
| | | name = conditionKey + "_XX4"; |
| | | } else if (70 <= conditionValue && conditionValue <= 94) { |
| | | name = conditionKey + "_XX5"; |
| | | } else if (conditionValue >= 95) { |
| | | name = conditionKey + "_XX6"; |
| | | } |
| | | TLibraryCode libraryCode = new TLibraryCode(); |
| | | libraryCode.setLangTypeContext(keyValue, langType); |
| | | return libraryCode; |
| | | } |
| | | @Override |
| | | public Map<String, String> getMAQwaterDropsImages() { |
| | | return null; |
| | | } |
| | | } |
New file |
| | |
| | | package com.ots.project.tool.report.MAQNEW.condition; |
| | | import com.ots.common.enums.LangTypeEnum; |
| | | import com.ots.project.exam.domain.TLibraryCode; |
| | | import com.ots.project.tool.report.MAQNEW.base.BaseCondition_V2; |
| | | import lombok.Getter; |
| | | import lombok.Setter; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import java.util.Map; |
| | | @Slf4j |
| | | @Getter |
| | | @Setter |
| | | public class SimpleMessage_V2 extends BaseCondition_V2 { |
| | | private String name; |
| | | public SimpleMessage_V2(String codeId) { |
| | | this.name = codeId; |
| | | } |
| | | @Override |
| | | public TLibraryCode calculate(Map<String, String> map, LangTypeEnum langType) { |
| | | TLibraryCode library = getMaqReportLibrary(map, name, langType); |
| | | return library; |
| | | } |
| | | @Override |
| | | public Map<String, String> getMAQwaterDropsImages() { |
| | | return null; |
| | | } |
| | | } |