package com.ots.project.tool.report.PAQ.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.Data;
|
import lombok.Getter;
|
import lombok.Setter;
|
import lombok.extern.slf4j.Slf4j;
|
|
import java.util.*;
|
|
/**
|
* 测试结果有效性诊断
|
*/
|
@Data
|
@Slf4j
|
public class Diagnosis extends BaseCondition_V2 {
|
private String name = "Diagnosis";
|
private Double P_SDE23;
|
private Double P_IM24;
|
private Double P_INCON25;
|
|
@Override
|
public TLibraryCode calculate(Map<String, String> map, LangTypeEnum langType) {
|
return null;
|
}
|
|
@Override
|
public Map<String, String> getMAQwaterDropsImages() {
|
return null;
|
}
|
|
@Override
|
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 LIBPAQGS8801_3 = (P_SDE_T1 >= 95 || P_IM_T1 >= 95 || P_INCON_T1 >= 95) && (P_SDE23 >= 95 || P_IM24 >= 95 || P_INCON25 >= 95);
|
boolean LIBPAQGS8802_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 LIBPAQGS8803_3 = false;
|
boolean LIBPAQGS8803_3_1 = (P_SDE_T1 >= 95 || P_IM_T1 >= 95 || P_INCON_T1 >= 95) && (P_SDE23 <= 5 && 5 < P_IM24 && P_IM24 < 95) && (P_INCON25 < 95);
|
boolean LIBPAQGS8803_3_2 = (P_SDE_T1 >= 95 || P_IM_T1 >= 95 || P_INCON_T1 >= 95) && (5 < P_SDE23 && P_SDE23 < 95 && P_IM24 <= 5) && (P_INCON25 < 95);
|
boolean LIBPAQGS8803_3_3 = (P_SDE_T1 >= 95 || P_IM_T1 >= 95 || P_INCON_T1 >= 95) && (P_SDE23 <= 5 && P_IM24 <= 5) && (P_INCON25 < 95);
|
//三个条件 其中一个符合就返回true
|
if(LIBPAQGS8803_3_1 || LIBPAQGS8803_3_2 || LIBPAQGS8803_3_3){
|
LIBPAQGS8803_3 = true;
|
}
|
boolean LIBPAQGS8804_3 = (P_SDE_T1 < 95 && P_IM_T1 < 95 && P_INCON_T1 < 95) && (P_SDE23 >= 95 || P_IM24 >= 95 || P_INCON25 >= 95);
|
boolean LIBPAQGS8805_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 LIBPAQGS8806_3 = false;
|
boolean LIBPAQGS8806_3_1 = (P_SDE_T1 < 95 && P_IM_T1 < 95 && P_INCON_T1 < 95) && (P_SDE23 <= 5 && 5 < P_IM24 && P_IM24 < 95) && (P_INCON25 < 95);
|
boolean LIBPAQGS8806_3_2 = (P_SDE_T1 < 95 && P_IM_T1 < 95 && P_INCON_T1 < 95) && (5 < P_SDE23 && P_SDE23 < 95 && P_IM24 <= 5) && (P_INCON25 < 95);
|
boolean LIBPAQGS8806_3_3 = (P_SDE_T1 < 95 && P_IM_T1 < 95 && P_INCON_T1 < 95) && (P_SDE23 <= 5 && P_IM24 <= 5) && (P_INCON25 < 95);
|
//三个条件 其中一个符合就返回true
|
if(LIBPAQGS8806_3_1 || LIBPAQGS8806_3_2 || LIBPAQGS8806_3_3){
|
LIBPAQGS8806_3 = true;
|
}
|
|
|
Map calculateMap = new HashMap();
|
calculateMap.put(LIBPAQGS8801_3, "LIBPAQGS88011,LIBPAQGS88012,LIBPAQGS88013");
|
calculateMap.put(LIBPAQGS8802_3, "LIBPAQGS88021,LIBPAQGS88022,LIBPAQGS88023");
|
calculateMap.put(LIBPAQGS8803_3, "LIBPAQGS88031,LIBPAQGS88032,LIBPAQGS88033");
|
calculateMap.put(LIBPAQGS8804_3, "LIBPAQGS88041,LIBPAQGS88042,LIBPAQGS88043");
|
calculateMap.put(LIBPAQGS8805_3, "LIBPAQGS88051,LIBPAQGS88052,LIBPAQGS88053");
|
calculateMap.put(LIBPAQGS8806_3, "LIBPAQGS88061,LIBPAQGS88062,LIBPAQGS88063");
|
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("Diagnosis error:{}", ex.getMessage(), ex);
|
return null;
|
}
|
}
|
}
|