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