Commit 56dd0956 authored by KeYong's avatar KeYong

修改鄱阳湖现场余量显示问题

parent 4ac1523f
...@@ -30,6 +30,7 @@ import org.typroject.tyboot.core.restful.doc.TycloudOperation; ...@@ -30,6 +30,7 @@ import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest; import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import org.typroject.tyboot.core.restful.utils.ResponseModel; import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.math.BigDecimal;
import java.text.ParseException; import java.text.ParseException;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.*; import java.util.*;
...@@ -89,7 +90,14 @@ public class SupervisionConfigureController extends AbstractBaseController { ...@@ -89,7 +90,14 @@ public class SupervisionConfigureController extends AbstractBaseController {
} else { } else {
m.put("levelStatus", "--"); m.put("levelStatus", "--");
} }
m.put("levelAbs", transResult.get("abs")); m.put("abs", transResult.get("abs"));
if (!String.valueOf(transResult.get("abs")).equals("--") && !ObjectUtils.isEmpty(m.get("volume"))) {
BigDecimal divide = new BigDecimal(100);
BigDecimal bigDecimal = new BigDecimal(String.valueOf(m.get("volume"))).multiply(new BigDecimal(String.valueOf(transResult.get("abs")))).divide(divide, 0, BigDecimal.ROUND_HALF_UP);
m.put("levelAbs", bigDecimal + "m³ " + " (" + transResult.get("abs") + "%)");
} else {
m.put("levelAbs", transResult.get("abs"));
}
} }
} }
return CommonResponseUtil.success(page1); return CommonResponseUtil.success(page1);
......
...@@ -25,6 +25,7 @@ import org.springframework.stereotype.Service; ...@@ -25,6 +25,7 @@ import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
import java.math.BigDecimal;
import java.text.DecimalFormat; import java.text.DecimalFormat;
import java.text.ParseException; import java.text.ParseException;
import java.util.*; import java.util.*;
...@@ -96,7 +97,13 @@ public class EmergencyServiceImpl implements IEmergencyService { ...@@ -96,7 +97,13 @@ public class EmergencyServiceImpl implements IEmergencyService {
} else { } else {
m.put("statusDesc", "--"); m.put("statusDesc", "--");
} }
m.put("sxyl", transResult.get("abs")); if (!String.valueOf(transResult.get("abs")).equals("--") && !ObjectUtils.isEmpty(m.get("volume"))) {
BigDecimal divide = new BigDecimal(100);
BigDecimal bigDecimal = new BigDecimal(String.valueOf(m.get("volume"))).multiply(new BigDecimal(String.valueOf(transResult.get("abs")))).divide(divide, 0, BigDecimal.ROUND_HALF_UP);
m.put("sxyl", bigDecimal + "m³ " + " (" + transResult.get("abs") + "%)");
} else {
m.put("sxyl", transResult.get("abs"));
}
} }
} }
return Optional.ofNullable(list).orElse(Lists.newArrayList()); return Optional.ofNullable(list).orElse(Lists.newArrayList());
...@@ -131,7 +138,13 @@ public class EmergencyServiceImpl implements IEmergencyService { ...@@ -131,7 +138,13 @@ public class EmergencyServiceImpl implements IEmergencyService {
} else { } else {
m.put("status", "--"); m.put("status", "--");
} }
m.put("abs", transResult.get("abs")); if (!String.valueOf(transResult.get("abs")).equals("--") && !ObjectUtils.isEmpty(m.get("volume"))) {
BigDecimal divide = new BigDecimal(100);
BigDecimal bigDecimal = new BigDecimal(String.valueOf(m.get("volume"))).multiply(new BigDecimal(String.valueOf(transResult.get("abs")))).divide(divide, 0, BigDecimal.ROUND_HALF_UP);
m.put("abs", bigDecimal + "m³ " + " (" + transResult.get("abs") + "%)");
} else {
m.put("abs", transResult.get("abs"));
}
} }
} }
return page1; return page1;
......
...@@ -45,7 +45,8 @@ ...@@ -45,7 +45,8 @@
a.sxrj, a.sxrj,
a.`unit`, a.`unit`,
a.minLevel, a.minLevel,
a.maxLevel a.maxLevel,
a.volume
FROM FROM
wl_equipment_specific wes wl_equipment_specific wes
LEFT JOIN ( LEFT JOIN (
...@@ -58,7 +59,8 @@ ...@@ -58,7 +59,8 @@
CASE CASE
WHEN ( SELECT IFNULL( wfie.field_value, 0 ) FROM wl_form_instance_equip wfie WHERE wfie.instance_id = wlesi.equipment_specific_id AND field_name = 'volume' ) <![CDATA[<>]]> 0 THEN WHEN ( SELECT IFNULL( wfie.field_value, 0 ) FROM wl_form_instance_equip wfie WHERE wfie.instance_id = wlesi.equipment_specific_id AND field_name = 'volume' ) <![CDATA[<>]]> 0 THEN
CONCAT(( SELECT field_value FROM wl_form_instance_equip wfie WHERE wfie.instance_id = wlesi.equipment_specific_id AND field_name = 'volume' ),'m³') ELSE '--m³' CONCAT(( SELECT field_value FROM wl_form_instance_equip wfie WHERE wfie.instance_id = wlesi.equipment_specific_id AND field_name = 'volume' ),'m³') ELSE '--m³'
END AS sxrj END AS sxrj,
(SELECT IFNULL( wfie.field_value, 0 ) FROM wl_form_instance_equip wfie WHERE wfie.instance_id = wlesi.equipment_specific_id AND field_name = 'volume') AS volume
FROM FROM
wl_equipment_specific_index wlesi wl_equipment_specific_index wlesi
WHERE WHERE
......
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