Commit 8a112a8d authored by tianyiming's avatar tianyiming

fix: 修复设备类别和定义为"all"时传入null的逻辑

parent f6a535a4
...@@ -178,10 +178,15 @@ public class ComprehensiveStatisticalAnalysisServiceImpl { ...@@ -178,10 +178,15 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
public JSONArray queryEquipmentSearchData(JSONObject jsonObject) { public JSONArray queryEquipmentSearchData(JSONObject jsonObject) {
String equList = jsonObject.getString("EQU_LIST"); String equList = jsonObject.getString("EQU_LIST");
String equCategory = jsonObject.getString("EQU_CATEGORY"); String equCategory = "all".equals(jsonObject.getString("EQU_CATEGORY")) ? null : jsonObject.getString("EQU_CATEGORY");
String equDefine = jsonObject.getString("EQU_DEFINE"); String equDefine = "all".equals(jsonObject.getString("EQU_DEFINE")) ? null : jsonObject.getString("EQU_DEFINE");
String vehicleCylinder = "1".equals(jsonObject.getString("WHETHER_VEHICLE_CYLINDER")) ? "vehicleCylinder" : null; String vehicleCylinder = "1".equals(jsonObject.getString("WHETHER_VEHICLE_CYLINDER")) ? "vehicleCylinder" : null;
List<TechParamItem> paramMetaList = TechParamUtil.getParamMetaList(equList, equCategory, equDefine, vehicleCylinder); List<TechParamItem> paramMetaList = new ArrayList<>();
if (vehicleCylinder != null) {
paramMetaList = TechParamUtil.getParamMetaList(equList, equCategory, equDefine, vehicleCylinder);
} else {
paramMetaList = TechParamUtil.getParamMetaList(equList, equCategory, equDefine);
}
JSONArray list = new JSONArray(); JSONArray list = new JSONArray();
for (int i = 0; i < paramMetaList.size(); i++) { for (int i = 0; i < paramMetaList.size(); i++) {
JSONObject object = new JSONObject(); JSONObject object = new JSONObject();
...@@ -2589,13 +2594,18 @@ public class ComprehensiveStatisticalAnalysisServiceImpl { ...@@ -2589,13 +2594,18 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
public JSONArray queryTechParam(JSONObject jsonObject) { public JSONArray queryTechParam(JSONObject jsonObject) {
String equList = jsonObject.getString("EQU_LIST_CODE"); String equList = jsonObject.getString("EQU_LIST_CODE");
String equCategory = jsonObject.getString("EQU_CATEGORY_CODE"); String equCategory = "all".equals(jsonObject.getString("EQU_CATEGORY_CODE")) ? null : jsonObject.getString("EQU_CATEGORY");
String equDefine = jsonObject.getString("EQU_DEFINE_CODE"); String equDefine = "all".equals(jsonObject.getString("EQU_DEFINE_CODE")) ? null : jsonObject.getString("EQU_DEFINE");
String vehicleCylinder = "1".equals(jsonObject.getString("WHETHER_VEHICLE_CYLINDER")) ? "vehicleCylinder" : null; String vehicleCylinder = "1".equals(jsonObject.getString("WHETHER_VEHICLE_CYLINDER")) ? "vehicleCylinder" : null;
if ("".equals(equList) || null == equList) { if ("".equals(equList) || null == equList) {
throw new BaseException("需要先选择设备种类,才能选择技术参数", "200", "需要先选择设备种类,才能选择技术参数"); throw new BaseException("需要先选择设备种类,才能选择技术参数", "200", "需要先选择设备种类,才能选择技术参数");
} }
List<TechParamItem> paramMetaList = TechParamUtil.getParamMetaList(equList, equCategory, equDefine, vehicleCylinder); List<TechParamItem> paramMetaList = new ArrayList<>();
if (vehicleCylinder != null) {
paramMetaList = TechParamUtil.getParamMetaList(equList, equCategory, equDefine, vehicleCylinder);
} else {
paramMetaList = TechParamUtil.getParamMetaList(equList, equCategory, equDefine);
}
JSONArray list = new JSONArray(); JSONArray list = new JSONArray();
for (int i = 0; i < paramMetaList.size(); i++) { for (int i = 0; i < paramMetaList.size(); i++) {
JSONObject object = new JSONObject(); JSONObject object = new JSONObject();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment