|
@@ -72,7 +72,13 @@ public class DataServiceImpl implements DataService {
|
|
paramMap.put("number", energyWater.getChipCode());
|
|
paramMap.put("number", energyWater.getChipCode());
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
paramMap.put("date", sdf.format(energyWater.getCreateDate()));
|
|
paramMap.put("date", sdf.format(energyWater.getCreateDate()));
|
|
- paramMap.put("dosage", energyWater.getWaterValue());
|
|
|
|
|
|
+ Double aDouble = Double.valueOf(energyWater.getWaterValue());
|
|
|
|
+ if (aDouble > 100) {
|
|
|
|
+ paramMap.put("dosage", "0");
|
|
|
|
+ } else {
|
|
|
|
+ paramMap.put("dosage", energyWater.getWaterValue());
|
|
|
|
+ }
|
|
|
|
+
|
|
paramMap.put("reading", energyWater.getOther3());
|
|
paramMap.put("reading", energyWater.getOther3());
|
|
paramMap.put("type", "水表");
|
|
paramMap.put("type", "水表");
|
|
String result = HttpRequest.post("http://wxdj.htpig.cn:9006/index.php/index/hydropower/hydropowerAdd").header(Header.CONTENT_TYPE, "application/json")
|
|
String result = HttpRequest.post("http://wxdj.htpig.cn:9006/index.php/index/hydropower/hydropowerAdd").header(Header.CONTENT_TYPE, "application/json")
|
|
@@ -91,7 +97,13 @@ public class DataServiceImpl implements DataService {
|
|
paramMap.put("number", energyElectricity.getChipCode());
|
|
paramMap.put("number", energyElectricity.getChipCode());
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
paramMap.put("date", sdf.format(energyElectricity.getCreateDate()));
|
|
paramMap.put("date", sdf.format(energyElectricity.getCreateDate()));
|
|
- paramMap.put("dosage", energyElectricity.getElectricityValue());
|
|
|
|
|
|
+ Double aDouble = Double.valueOf(energyElectricity.getElectricityValue());
|
|
|
|
+ if (aDouble > 1000) {
|
|
|
|
+ paramMap.put("dosage", "0");
|
|
|
|
+ } else {
|
|
|
|
+ paramMap.put("dosage", energyElectricity.getElectricityValue());
|
|
|
|
+ }
|
|
|
|
+
|
|
paramMap.put("reading", energyElectricity.getOther3());
|
|
paramMap.put("reading", energyElectricity.getOther3());
|
|
paramMap.put("type", "电表");
|
|
paramMap.put("type", "电表");
|
|
String result = HttpRequest.post("http://wxdj.htpig.cn:9006/index.php/index/hydropower/hydropowerAdd").header(Header.CONTENT_TYPE, "application/json")
|
|
String result = HttpRequest.post("http://wxdj.htpig.cn:9006/index.php/index/hydropower/hydropowerAdd").header(Header.CONTENT_TYPE, "application/json")
|