...
|
...
|
@@ -5,11 +5,14 @@ import com.alibaba.fastjson.JSONArray; |
|
|
import com.sunyo.energy.location.dao.WaterMeterMapper;
|
|
|
import com.sunyo.energy.location.model.WaterMeter;
|
|
|
import com.sunyo.energy.location.service.WaterMeterService;
|
|
|
import com.sunyo.energy.location.utils.HttpsUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.scheduling.annotation.Scheduled;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import utils.HttpsUtils;
|
|
|
import java.util.Date;
|
|
|
import java.util.HashMap;
|
|
|
import java.util.Map;
|
|
|
|
|
|
import java.util.*;
|
|
|
|
|
|
@Service
|
|
|
public class WaterMeterServiceImp implements WaterMeterService {
|
...
|
...
|
@@ -19,6 +22,7 @@ public class WaterMeterServiceImp implements WaterMeterService { |
|
|
|
|
|
|
|
|
@Override
|
|
|
@Scheduled(cron = "0 0 10 * * ?" )
|
|
|
public int realTime() {
|
|
|
|
|
|
try {
|
...
|
...
|
@@ -26,9 +30,7 @@ public class WaterMeterServiceImp implements WaterMeterService { |
|
|
String url = "http://123.56.159.203:8023/nowwmrd/getSelectNowwmrdbyProjectID";
|
|
|
Map<String, Object> datas = new HashMap<>();
|
|
|
datas.put("ProjectID", "33-99-00-00-00-00-01");
|
|
|
|
|
|
String s = HttpsUtils.httpRequest(url, datas);
|
|
|
List<WaterMeter> waterMeterList = new ArrayList<>();
|
|
|
JSONArray jsonArray = JSON.parseArray(s);
|
|
|
for (Object jsonObject:jsonArray){
|
|
|
WaterMeter waterMeter= new WaterMeter();
|
...
|
...
|
|