808917fd 张雷

数据同步问题修复

1 个父辈 2f319ed0
......@@ -8,6 +8,7 @@ import com.skua.modules.system.datestandard.entity.SysMonitorMetricInfo;
import com.skua.modules.system.datestandard.service.ISysMonitorMetricInfoService;
import com.skua.modules.system.service.IPgService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -35,10 +36,22 @@ public class DayDataSyncJob implements Job {
@Autowired
private IReportDataService reportDataService;
/**
* 若参数变量名修改 QuartzJobController中也需对应修改
*/
private String parameter;
public void setParameter(String parameter) {
this.parameter = parameter;
}
@Override
public void execute(JobExecutionContext jobExecutionContext) {
log.info("开始同步昨天的数据入报表");
String yesterday = DateUtils.getYesterday();
if(StringUtils.isNotEmpty(this.parameter)){
yesterday = this.parameter;
}
DecimalFormat df = new DecimalFormat("######0.0000");
List<SysFactoryDevice> deviceList = sysFactoryDeviceService.getList();
if(deviceList.size() > 0){
......@@ -57,7 +70,12 @@ public class DayDataSyncJob implements Job {
}
}
if(!"".equals(fields)){
Map<String, Object> dataMap = pgService.queryDayData(fields, deviceId, yesterday);
Map<String, Object> dataMap = new HashMap<>();
try{
dataMap = pgService.queryDayData(fields, deviceId, yesterday);
}catch (Exception e){
dataMap = new HashMap<>();
}
Map<String, String> data = new HashMap<>();
if(dataMap.size() != 0){
if(tagMap.get("CSLL-"+departId)!=null){
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!