修改bug
This commit is contained in:
parent
46370fc12a
commit
0e8cfd6af1
|
|
@ -67,5 +67,7 @@ public class Markinfo implements Serializable {
|
|||
private String heatStationId; // 热站的id
|
||||
@TableField(exist = false)
|
||||
private String heatStationName; // 热站的名称
|
||||
@TableField(exist = false)
|
||||
private String companyName; // 热站的名称
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,6 +2,8 @@ package org.jeecg.modules.heating.job;
|
|||
|
||||
import cn.hutool.json.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.google.gson.JsonObject;
|
||||
import com.google.gson.JsonParser;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.http.HttpEntity;
|
||||
|
|
@ -14,7 +16,9 @@ import org.apache.http.impl.client.HttpClientBuilder;
|
|||
import org.apache.http.util.EntityUtils;
|
||||
import org.jeecg.common.util.DateUtils;
|
||||
import org.jeecg.modules.heating.entity.Heatanalysis;
|
||||
import org.jeecg.modules.heating.entity.Simconfig;
|
||||
import org.jeecg.modules.heating.service.HeatanalysisService;
|
||||
import org.jeecg.modules.heating.service.SimconfigService;
|
||||
import org.jeecg.modules.waterFlowConfig.entity.BlWaterFlowConfig;
|
||||
import org.jeecg.modules.waterFlowConfig.service.IBlWaterFlowConfigService;
|
||||
import org.quartz.Job;
|
||||
|
|
@ -46,6 +50,9 @@ public class FlowanalysisJob implements Job {
|
|||
@Autowired
|
||||
private IBlWaterFlowConfigService WaterFlowConfigService;
|
||||
|
||||
@Autowired
|
||||
private SimconfigService simconfigService;
|
||||
|
||||
@Override
|
||||
public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
|
||||
|
||||
|
|
@ -57,45 +64,49 @@ public class FlowanalysisJob implements Job {
|
|||
try{
|
||||
String sn = config.getSn();
|
||||
String json = getWebInfo(sn);
|
||||
System.out.println("json:"+json);
|
||||
log.info("json:"+json);
|
||||
if(StringUtils.equals(json,"false")) continue;
|
||||
JSONObject jsonObject = new JSONObject(json);
|
||||
JsonObject jsonObject = JsonParser.parseString(json).getAsJsonObject();
|
||||
|
||||
log.info("jsonObject:"+jsonObject);
|
||||
String success = jsonObject.getStr("success");
|
||||
String success = jsonObject.get("success").getAsString();
|
||||
if(StringUtils.equals(success,"true")){
|
||||
// QueryWrapper<Heatanalysis> heatanalysisQueryWrapper = new QueryWrapper<>();
|
||||
// heatanalysisQueryWrapper.eq("view031",sn);
|
||||
// heatanalysisQueryWrapper.last("limit 1");
|
||||
// Heatanalysis heatanalysis = heatanalysisService.getOne(heatanalysisQueryWrapper);
|
||||
|
||||
// QueryWrapper<Simconfig> simconfigQueryWrapper = new QueryWrapper<>();
|
||||
// simconfigQueryWrapper.eq("source_source_id",config.getSourceSourceId());
|
||||
//
|
||||
// Simconfig simconfig = simconfigService.getOne(simconfigQueryWrapper);
|
||||
|
||||
|
||||
Heatanalysis heatanalysis = new Heatanalysis();
|
||||
// if(heatanalysis != null){
|
||||
// String view032_old = heatanalysis.getView032();
|
||||
String data = jsonObject.getStr("data");
|
||||
JSONObject dataObject = new JSONObject(data);
|
||||
String view032 = dataObject.getStr("logat");
|
||||
// if(StringUtils.equals(view032,view032_old)){
|
||||
// log.info("--------数据重复---------");
|
||||
// continue;
|
||||
// }
|
||||
String view033 = dataObject.getStr("ID");
|
||||
String view034 = dataObject.getStr("valid");
|
||||
String view035 = dataObject.getStr("gswd");
|
||||
String view036 = dataObject.getStr("hswd");
|
||||
String view037 = dataObject.getStr("flowRate");
|
||||
String view037_2 = dataObject.getStr("ssll");
|
||||
String view038 = dataObject.getStr("pflowAccumulator");
|
||||
String view038_2 = dataObject.getStr("zljll");
|
||||
String view039 = dataObject.getStr("nflowAccumulator");
|
||||
String view039_2 = dataObject.getStr("fljll");
|
||||
String view040 = dataObject.getStr("netflowAccumulator");
|
||||
String view040_2 = dataObject.getStr("jljll");
|
||||
String view041 = dataObject.getStr("ssrl");
|
||||
String view042 = dataObject.getStr("zljrl");
|
||||
String view043 = dataObject.getStr("fljrl");
|
||||
String view044 = dataObject.getStr("jljrl");
|
||||
String view045 = dataObject.getStr("ltsd");
|
||||
String view046 = dataObject.getStr("n");
|
||||
String view047 = dataObject.getStr("m");
|
||||
heatanalysis.setView031(sn);
|
||||
|
||||
JsonObject dataObject = jsonObject.get("data").getAsJsonObject();
|
||||
String view032 = dataObject.get("logat").getAsString();
|
||||
String view033 = dataObject.get("ID").getAsString();
|
||||
String view034 = dataObject.get("valid").getAsString();
|
||||
String view035 = dataObject.get("gswd").getAsString();
|
||||
String view036 = dataObject.get("hswd").getAsString();
|
||||
String view037 = dataObject.get("flowRate").getAsString();
|
||||
String view037_2 = dataObject.get("ssll").getAsString();
|
||||
String view038 = dataObject.get("pflowAccumulator").getAsString();
|
||||
String view038_2 = dataObject.get("zljll").getAsString();
|
||||
String view039 = dataObject.get("nflowAccumulator").getAsString();
|
||||
String view039_2 = dataObject.get("fljll").getAsString();
|
||||
String view040 = dataObject.get("netflowAccumulator").getAsString();
|
||||
String view040_2 = dataObject.get("jljll").getAsString();
|
||||
String view041 = dataObject.get("ssrl").getAsString();
|
||||
String view042 = dataObject.get("zljrl").getAsString();
|
||||
String view043 = dataObject.get("fljrl").getAsString();
|
||||
String view044 = dataObject.get("jljrl").getAsString();
|
||||
String view045 = dataObject.get("ltsd").getAsString();
|
||||
String view046 = dataObject.get("n").getAsString();
|
||||
String view047 = dataObject.get("m").getAsString();
|
||||
|
||||
|
||||
|
||||
heatanalysis.setView031(sn);
|
||||
heatanalysis.setView032(view032);
|
||||
heatanalysis.setView033(view033);
|
||||
heatanalysis.setView034(view034);
|
||||
|
|
|
|||
|
|
@ -79,7 +79,8 @@
|
|||
<select id="sourceList" resultType="org.jeecg.modules.heating.entity.Markinfo">
|
||||
SELECT
|
||||
a.id AS heatSourceId,
|
||||
a.source_name AS heatSourceName
|
||||
a.source_name AS heatSourceName,
|
||||
a.company_name as companyName
|
||||
FROM bl_heatsource a
|
||||
WHERE a.del_flag = '0'
|
||||
and a.id not in (
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@
|
|||
</select>
|
||||
|
||||
<select id="findSourceList" resultType="org.jeecg.modules.heating.entity.Simconfig">
|
||||
SELECT id as sourceId, source_name as sourceName
|
||||
SELECT id as sourceId, source_name as sourceName,a.company_name as companyName
|
||||
FROM bl_heatsource a
|
||||
<where>
|
||||
a.del_flag = '0'
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ public class BlWaterFlowConfig implements Serializable {
|
|||
|
||||
/**主键*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
private java.lang.Integer id;
|
||||
private java.lang.String id;
|
||||
/**sn*/
|
||||
@Excel(name = "sn", width = 15)
|
||||
private java.lang.String sn;
|
||||
|
|
|
|||
Loading…
Reference in New Issue