Commit fe3b967a authored by tangwei's avatar tangwei

解决冲突

parents dca6c5d4 3f657e9e
package com.yeejoin.amos.boot.module.jxiop.biz.controller; package com.yeejoin.amos.boot.module.jxiop.biz.controller;
import cn.hutool.core.date.DatePattern;
import cn.hutool.core.date.DateUtil;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
...@@ -68,6 +70,8 @@ public class IdxBizFanHealthIndexController extends BaseController { ...@@ -68,6 +70,8 @@ public class IdxBizFanHealthIndexController extends BaseController {
@Autowired @Autowired
FanWaringRecordMapper fanWarningRecord; FanWaringRecordMapper fanWarningRecord;
public final DecimalFormat df = new DecimalFormat("#.0"); public final DecimalFormat df = new DecimalFormat("#.0");
public final DecimalFormat dfSS = new DecimalFormat("#.00");
/** /**
* 新增 * 新增
* *
...@@ -763,7 +767,7 @@ public class IdxBizFanHealthIndexController extends BaseController { ...@@ -763,7 +767,7 @@ public class IdxBizFanHealthIndexController extends BaseController {
if (type.equals("0")){ if (type.equals("0")){
seriesData.add(Double.parseDouble(df.format(obj.getHealthIndex()))); seriesData.add(Double.parseDouble(df.format(obj.getHealthIndex())));
}else { }else {
seriesData.add(obj.getAnomaly() > 7.5?7.5:obj.getAnomaly()); seriesData.add(obj.getAnomaly() > 7.5?7.5:dfSS.format(obj.getAnomaly()));
} }
axisData.add(obj.getAnalysisTime()); axisData.add(obj.getAnalysisTime());
} }
...@@ -784,9 +788,11 @@ public class IdxBizFanHealthIndexController extends BaseController { ...@@ -784,9 +788,11 @@ public class IdxBizFanHealthIndexController extends BaseController {
if (type.equals("0")){ if (type.equals("0")){
seriesData.add(Double.parseDouble(df.format(obj.getHealthIndex()))); seriesData.add(Double.parseDouble(df.format(obj.getHealthIndex())));
}else { }else {
seriesData.add(obj.getAnomaly() > 7.5?7.5:obj.getAnomaly()); seriesData.add(obj.getAnomaly() > 7.5 ? 7.5 : dfSS.format(obj.getAnomaly()));
} }
axisData.add(obj.getAnalysisTime()); Date dateTime = DateUtil.parseDateTime(obj.getAnalysisTime());
String format = DateUtil.format(dateTime, "yyyy-MM-dd HH:00");
axisData.add(format);
} }
result.put("seriesData",seriesData); result.put("seriesData",seriesData);
result.put("axisData",axisData); result.put("axisData",axisData);
...@@ -806,9 +812,11 @@ public class IdxBizFanHealthIndexController extends BaseController { ...@@ -806,9 +812,11 @@ public class IdxBizFanHealthIndexController extends BaseController {
if (type.equals("0")){ if (type.equals("0")){
seriesData.add(Double.parseDouble(df.format(obj.getHealthIndex()))); seriesData.add(Double.parseDouble(df.format(obj.getHealthIndex())));
}else { }else {
seriesData.add(obj.getAnomaly() > 7.5?7.5:obj.getAnomaly()); seriesData.add(obj.getAnomaly() > 7.5 ? 7.5 : dfSS.format(obj.getAnomaly()));
} }
axisData.add(obj.getAnalysisTime()); Date dateTime = DateUtil.parseDateTime(obj.getAnalysisTime());
String format = DateUtil.format(dateTime, DatePattern.NORM_DATETIME_MINUTE_PATTERN);
axisData.add(format);
} }
result.put("seriesData",seriesData); result.put("seriesData",seriesData);
result.put("axisData",axisData); result.put("axisData",axisData);
......
package com.yeejoin.amos.boot.module.jxiop.biz.controller; package com.yeejoin.amos.boot.module.jxiop.biz.controller;
import cn.hutool.core.date.DatePattern;
import cn.hutool.core.date.DateUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.controller.BaseController; import com.yeejoin.amos.boot.biz.common.controller.BaseController;
...@@ -57,6 +59,8 @@ public class IdxBizPvHealthIndexController extends BaseController { ...@@ -57,6 +59,8 @@ public class IdxBizPvHealthIndexController extends BaseController {
IdxBizPvPointProcessVariableClassificationMapper idxBizPvPointProcessVariableClassificationMapper; IdxBizPvPointProcessVariableClassificationMapper idxBizPvPointProcessVariableClassificationMapper;
public final DecimalFormat df = new DecimalFormat("0.0"); public final DecimalFormat df = new DecimalFormat("0.0");
public final DecimalFormat dfSS = new DecimalFormat("0.00");
/** /**
* 新增 * 新增
* *
...@@ -430,7 +434,7 @@ public class IdxBizPvHealthIndexController extends BaseController { ...@@ -430,7 +434,7 @@ public class IdxBizPvHealthIndexController extends BaseController {
if (type.equals("0")){ if (type.equals("0")){
seriesData.add(Double.parseDouble(df.format(obj.getHealthIndex()))); seriesData.add(Double.parseDouble(df.format(obj.getHealthIndex())));
}else { }else {
seriesData.add(obj.getAnomaly() > 7.5?7.5:obj.getAnomaly()); seriesData.add(obj.getAnomaly() > 7.5?7.5:dfSS.format(obj.getAnomaly()));
} }
axisData.add(obj.getAnalysisTime()); axisData.add(obj.getAnalysisTime());
} }
...@@ -451,9 +455,11 @@ public class IdxBizPvHealthIndexController extends BaseController { ...@@ -451,9 +455,11 @@ public class IdxBizPvHealthIndexController extends BaseController {
if (type.equals("0")){ if (type.equals("0")){
seriesData.add(Double.parseDouble(df.format(obj.getHealthIndex()))); seriesData.add(Double.parseDouble(df.format(obj.getHealthIndex())));
}else { }else {
seriesData.add(obj.getAnomaly() > 7.5?7.5:obj.getAnomaly()); seriesData.add(obj.getAnomaly() > 7.5?7.5:dfSS.format(obj.getAnomaly()));
} }
axisData.add(obj.getAnalysisTime()); Date dateTime = DateUtil.parseDateTime(obj.getAnalysisTime());
String format = DateUtil.format(dateTime, "yyyy-MM-dd HH:00");
axisData.add(format);
} }
result.put("seriesData",seriesData); result.put("seriesData",seriesData);
result.put("axisData",axisData); result.put("axisData",axisData);
...@@ -476,14 +482,10 @@ public class IdxBizPvHealthIndexController extends BaseController { ...@@ -476,14 +482,10 @@ public class IdxBizPvHealthIndexController extends BaseController {
if (type.equals("0")){ if (type.equals("0")){
seriesData.add(Double.parseDouble(df.format(obj.getHealthIndex()))); seriesData.add(Double.parseDouble(df.format(obj.getHealthIndex())));
}else { }else {
seriesData.add(obj.getAnomaly() > 7.5?7.5:obj.getAnomaly()); seriesData.add(obj.getAnomaly() > 7.5?7.5:dfSS.format(obj.getAnomaly()));
}
Date format = null;
try {
format = formatterNYRSF.parse(obj.getAnalysisTime());
} catch (ParseException e) {
e.printStackTrace();
} }
Date dateTime = DateUtil.parseDateTime(obj.getAnalysisTime());
String format = DateUtil.format(dateTime, DatePattern.NORM_DATETIME_MINUTE_PATTERN);
axisData.add(format); axisData.add(format);
} }
result.put("seriesData",seriesData); result.put("seriesData",seriesData);
......
...@@ -23,6 +23,7 @@ import org.typroject.tyboot.core.restful.doc.TycloudOperation; ...@@ -23,6 +23,7 @@ import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.utils.ResponseHelper; import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel; import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.text.DecimalFormat;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
...@@ -155,6 +156,7 @@ public class KafkaAnalyseController { ...@@ -155,6 +156,7 @@ public class KafkaAnalyseController {
return ResponseHelper.buildResponse(indicatorData); return ResponseHelper.buildResponse(indicatorData);
} }
public final DecimalFormat df = new DecimalFormat("0.0");
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY) @TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@ApiOperation(value = "全景诊断回溯") @ApiOperation(value = "全景诊断回溯")
...@@ -192,7 +194,7 @@ public class KafkaAnalyseController { ...@@ -192,7 +194,7 @@ public class KafkaAnalyseController {
int subSystemInt = 1; int subSystemInt = 1;
Double healthScoreInfo = idxBizFanHealthIndexMapper.getHealthScoreInfoByParam(null, null, analysisType).doubleValue(); Double healthScoreInfo = idxBizFanHealthIndexMapper.getHealthScoreInfoByParam(null, null, analysisType).doubleValue();
healthScoreInfo = Double.parseDouble(df.format(healthScoreInfo));
LambdaQueryWrapper<IdxBizFanHealthLevel> query = new LambdaQueryWrapper<>(); LambdaQueryWrapper<IdxBizFanHealthLevel> query = new LambdaQueryWrapper<>();
query.isNull(IdxBizFanHealthLevel::getStatus); query.isNull(IdxBizFanHealthLevel::getStatus);
query.eq(IdxBizFanHealthLevel::getAnalysisObjType, "全域"); query.eq(IdxBizFanHealthLevel::getAnalysisObjType, "全域");
...@@ -216,7 +218,7 @@ public class KafkaAnalyseController { ...@@ -216,7 +218,7 @@ public class KafkaAnalyseController {
Double areaHighScore = null; Double areaHighScore = null;
Double areaHealthScoreInfo = idxBizFanHealthIndexMapper.getHealthScoreInfoByParam(areaMap.getKey(), null, analysisType).doubleValue(); Double areaHealthScoreInfo = idxBizFanHealthIndexMapper.getHealthScoreInfoByParam(areaMap.getKey(), null, analysisType).doubleValue();
areaHealthScoreInfo = Double.parseDouble(df.format(areaHealthScoreInfo));
LambdaQueryWrapper<IdxBizFanHealthLevel> areaQuery = new LambdaQueryWrapper<>(); LambdaQueryWrapper<IdxBizFanHealthLevel> areaQuery = new LambdaQueryWrapper<>();
areaQuery.isNull(IdxBizFanHealthLevel::getStatus); areaQuery.isNull(IdxBizFanHealthLevel::getStatus);
areaQuery.eq(IdxBizFanHealthLevel::getAnalysisObjType, "片区"); areaQuery.eq(IdxBizFanHealthLevel::getAnalysisObjType, "片区");
......
...@@ -17,6 +17,7 @@ import java.util.List; ...@@ -17,6 +17,7 @@ import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import com.yeejoin.amos.boot.module.jxiop.biz.tdengine.*;
import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.ObjectUtils;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -63,11 +64,6 @@ import com.yeejoin.amos.boot.module.jxiop.biz.tdMapper2.FanWaringRecordMapper; ...@@ -63,11 +64,6 @@ import com.yeejoin.amos.boot.module.jxiop.biz.tdMapper2.FanWaringRecordMapper;
import com.yeejoin.amos.boot.module.jxiop.biz.tdMapper2.PvHealthIndexDayMapper; import com.yeejoin.amos.boot.module.jxiop.biz.tdMapper2.PvHealthIndexDayMapper;
import com.yeejoin.amos.boot.module.jxiop.biz.tdMapper2.PvHealthIndexMapper; import com.yeejoin.amos.boot.module.jxiop.biz.tdMapper2.PvHealthIndexMapper;
import com.yeejoin.amos.boot.module.jxiop.biz.tdMapper2.PvWaringRecordMapper; import com.yeejoin.amos.boot.module.jxiop.biz.tdMapper2.PvWaringRecordMapper;
import com.yeejoin.amos.boot.module.jxiop.biz.tdengine.FanHealthIndex;
import com.yeejoin.amos.boot.module.jxiop.biz.tdengine.FanHealthIndexDay;
import com.yeejoin.amos.boot.module.jxiop.biz.tdengine.FanWarningRecord;
import com.yeejoin.amos.boot.module.jxiop.biz.tdengine.PvHealthIndex;
import com.yeejoin.amos.boot.module.jxiop.biz.tdengine.PvHealthIndexDay;
import com.yeejoin.amos.boot.module.jxiop.biz.tdmapper.IndicatorDataMapper; import com.yeejoin.amos.boot.module.jxiop.biz.tdmapper.IndicatorDataMapper;
import com.yeejoin.amos.component.feign.model.FeignClientResult; import com.yeejoin.amos.component.feign.model.FeignClientResult;
import com.yeejoin.amos.feign.privilege.Privilege; import com.yeejoin.amos.feign.privilege.Privilege;
...@@ -1543,4 +1539,53 @@ public class TDBigScreenAnalyseController extends BaseController { ...@@ -1543,4 +1539,53 @@ public class TDBigScreenAnalyseController extends BaseController {
return ResponseHelper.buildResponse(stringStringHashMap); return ResponseHelper.buildResponse(stringStringHashMap);
} }
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@ApiOperation(httpMethod = "GET", value = "字段修改 处置 改为 确认", notes = "字段修改 处置 改为 确认")
@GetMapping(value = "/updateState")
public ResponseModel updateState() {
List<FanWarningRecord> list = fanWaringRecordMapper.selectList(null);
list.forEach(item -> {
if ("未处置".equals(item.getDisposotionState())) {
item.setDisposotionState("待确认");
} else if ("已处置".equals(item.getDisposotionState())) {
item.setDisposotionState("已确认");
}
});
ArrayList<FanWarningRecord> newList = new ArrayList<>();
for (int i = 0; i < list.size(); i++) {
//分批次处理
newList.add(list.get(i));//循环将数据填入载体list
if (500 == newList.size() || i == list.size() - 1) { //载体list达到要求,进行批量操作
//调用批量插入
fanWaringRecordMapper.saveBatchWarningRecords(newList);
newList.clear();//每次批量操作后,清空载体list,等待下次的数据填入
}
}
List<PvWarningRecord> list2 = pvWaringRecordMapper.selectList(null);
list2.forEach(item -> {
if ("未处置".equals(item.getDisposotionState())) {
item.setDisposotionState("待确认");
} else if ("已处置".equals(item.getDisposotionState())) {
item.setDisposotionState("已确认");
}
});
ArrayList<PvWarningRecord> newList2 = new ArrayList<>();
for (int i = 0; i < list2.size(); i++) {
//分批次处理
newList2.add(list2.get(i));//循环将数据填入载体list
if (500 == newList2.size() || i == list2.size() - 1) { //载体list达到要求,进行批量操作
//调用批量插入
pvWaringRecordMapper.saveBatchWarningRecords(newList2);
newList2.clear();//每次批量操作后,清空载体list,等待下次的数据填入
}
}
return ResponseHelper.buildResponse(null);
}
} }
...@@ -121,6 +121,9 @@ public class TdInfoQueryController { ...@@ -121,6 +121,9 @@ public class TdInfoQueryController {
public static String convert(String camelCase) { public static String convert(String camelCase) {
StringBuilder result = new StringBuilder(); StringBuilder result = new StringBuilder();
if (camelCase.equals("analysisTime")) {
return "ts";
}
for (int i = 0; i < camelCase.length(); i++) { for (int i = 0; i < camelCase.length(); i++) {
char currentChar = camelCase.charAt(i); char currentChar = camelCase.charAt(i);
if (Character.isUpperCase(currentChar)) { if (Character.isUpperCase(currentChar)) {
......
...@@ -73,7 +73,7 @@ public class WarningRecordStatusMessage extends EmqxListener { ...@@ -73,7 +73,7 @@ public class WarningRecordStatusMessage extends EmqxListener {
List<JSONObject> taskList = JSONObject.parseArray(analysisResult.toJSONString(), JSONObject.class); List<JSONObject> taskList = JSONObject.parseArray(analysisResult.toJSONString(), JSONObject.class);
List<String> traceIds = taskList.stream().map(t -> t.get("extAttr1").toString()).collect(Collectors.toList()); List<String> traceIds = taskList.stream().map(t -> t.get("extAttr1").toString()).collect(Collectors.toList());
// LambdaUpdateWrapper<IdxBizFanWarningRecord> lambda = new LambdaUpdateWrapper<>(); // LambdaUpdateWrapper<IdxBizFanWarningRecord> lambda = new LambdaUpdateWrapper<>();
// lambda.set(IdxBizFanWarningRecord::getDisposotionState, "已处置"); // lambda.set(IdxBizFanWarningRecord::getDisposotionState, "已确认");
// lambda.set(IdxBizFanWarningRecord::getStatus, "1"); // lambda.set(IdxBizFanWarningRecord::getStatus, "1");
// lambda.set(IdxBizFanWarningRecord::getDisposotionDate, new Date()); // lambda.set(IdxBizFanWarningRecord::getDisposotionDate, new Date());
// lambda.in(IdxBizFanWarningRecord::getSequenceNbr, traceIds); // lambda.in(IdxBizFanWarningRecord::getSequenceNbr, traceIds);
...@@ -85,7 +85,7 @@ public class WarningRecordStatusMessage extends EmqxListener { ...@@ -85,7 +85,7 @@ public class WarningRecordStatusMessage extends EmqxListener {
fanWarningRecord.setTs(Long.valueOf(traceId)); fanWarningRecord.setTs(Long.valueOf(traceId));
fanWarningRecord.setDisposotionDate(DateUtil.now()); fanWarningRecord.setDisposotionDate(DateUtil.now());
fanWarningRecord.setStatus("1"); fanWarningRecord.setStatus("1");
fanWarningRecord.setDisposotionState("已处置"); fanWarningRecord.setDisposotionState("已确认");
list.add(fanWarningRecord); list.add(fanWarningRecord);
} }
fanWaringRecordMapper.updateStatusByTs(list); fanWaringRecordMapper.updateStatusByTs(list);
...@@ -110,7 +110,7 @@ public class WarningRecordStatusMessage extends EmqxListener { ...@@ -110,7 +110,7 @@ public class WarningRecordStatusMessage extends EmqxListener {
pvWarningRecord.setTs(Long.valueOf(traceId)); pvWarningRecord.setTs(Long.valueOf(traceId));
pvWarningRecord.setDisposotionDate(DateUtil.now()); pvWarningRecord.setDisposotionDate(DateUtil.now());
pvWarningRecord.setStatus("1"); pvWarningRecord.setStatus("1");
pvWarningRecord.setDisposotionState("已处置"); pvWarningRecord.setDisposotionState("已确认");
list.add(pvWarningRecord); list.add(pvWarningRecord);
} }
pvWaringRecordMapper.updateStatusByTs(list); pvWaringRecordMapper.updateStatusByTs(list);
......
...@@ -161,7 +161,7 @@ public class CommonServiceImpl { ...@@ -161,7 +161,7 @@ public class CommonServiceImpl {
@Autowired @Autowired
private TdengineTimeServiceImpl tdengineTimeService; private TdengineTimeServiceImpl tdengineTimeService;
public final DecimalFormat df = new DecimalFormat("#.0"); public final DecimalFormat df = new DecimalFormat("#.00");
/** /**
* @return * @return
......
...@@ -281,7 +281,7 @@ public class HealthStatusIndicatorServiceImpl { ...@@ -281,7 +281,7 @@ public class HealthStatusIndicatorServiceImpl {
idxBizPvWarningRecord.setIndexAddress(address); idxBizPvWarningRecord.setIndexAddress(address);
idxBizPvWarningRecord.setEquipmentName(idxBizPvHealthIndices.get(0).getEquipmentName()); idxBizPvWarningRecord.setEquipmentName(idxBizPvHealthIndices.get(0).getEquipmentName());
idxBizPvWarningRecord.setAnalysisPointId(idxBizPvHealthIndices.get(0).getAnalysisObjSeq()); idxBizPvWarningRecord.setAnalysisPointId(idxBizPvHealthIndices.get(0).getAnalysisObjSeq());
idxBizPvWarningRecord.setDisposotionState("未处置"); idxBizPvWarningRecord.setDisposotionState("待确认");
idxBizPvWarningRecord.setStatus("0"); idxBizPvWarningRecord.setStatus("0");
idxBizPvWarningRecord.setWarningName(level); idxBizPvWarningRecord.setWarningName(level);
idxBizPvWarningRecord.setCONTENT(idxBizPvHealthIndices.get(0).getPointName() + "连续"+content+"健康指数<"+num ); idxBizPvWarningRecord.setCONTENT(idxBizPvHealthIndices.get(0).getPointName() + "连续"+content+"健康指数<"+num );
...@@ -448,7 +448,7 @@ public class HealthStatusIndicatorServiceImpl { ...@@ -448,7 +448,7 @@ public class HealthStatusIndicatorServiceImpl {
idxBizPvWarningRecord.setIndexAddress(address); idxBizPvWarningRecord.setIndexAddress(address);
idxBizPvWarningRecord.setEquipmentName(idxBizPvHealthIndices.get(0).getEquipmentName()); idxBizPvWarningRecord.setEquipmentName(idxBizPvHealthIndices.get(0).getEquipmentName());
idxBizPvWarningRecord.setAnalysisPointId(idxBizPvHealthIndices.get(0).getAnalysisObjSeq()); idxBizPvWarningRecord.setAnalysisPointId(idxBizPvHealthIndices.get(0).getAnalysisObjSeq());
idxBizPvWarningRecord.setDisposotionState("未处置"); idxBizPvWarningRecord.setDisposotionState("待确认");
idxBizPvWarningRecord.setStatus("0"); idxBizPvWarningRecord.setStatus("0");
idxBizPvWarningRecord.setWarningName(level); idxBizPvWarningRecord.setWarningName(level);
idxBizPvWarningRecord.setCONTENT(idxBizPvHealthIndices.get(0).getPointName() + "连续"+content+"健康指数<"+num ); idxBizPvWarningRecord.setCONTENT(idxBizPvHealthIndices.get(0).getPointName() + "连续"+content+"健康指数<"+num );
...@@ -613,7 +613,7 @@ public class HealthStatusIndicatorServiceImpl { ...@@ -613,7 +613,7 @@ public class HealthStatusIndicatorServiceImpl {
idxBizPvWarningRecord.setIndexAddress(address); idxBizPvWarningRecord.setIndexAddress(address);
idxBizPvWarningRecord.setEquipmentName(idxBizPvHealthIndices.get(0).getEquipmentName()); idxBizPvWarningRecord.setEquipmentName(idxBizPvHealthIndices.get(0).getEquipmentName());
idxBizPvWarningRecord.setAnalysisPointId(idxBizPvHealthIndices.get(0).getAnalysisObjSeq()); idxBizPvWarningRecord.setAnalysisPointId(idxBizPvHealthIndices.get(0).getAnalysisObjSeq());
idxBizPvWarningRecord.setDisposotionState("未处置"); idxBizPvWarningRecord.setDisposotionState("待确认");
idxBizPvWarningRecord.setStatus("0"); idxBizPvWarningRecord.setStatus("0");
idxBizPvWarningRecord.setWarningName(level); idxBizPvWarningRecord.setWarningName(level);
idxBizPvWarningRecord.setCONTENT(idxBizPvHealthIndices.get(0).getPointName() + "连续"+content+"健康指数<"+num ); idxBizPvWarningRecord.setCONTENT(idxBizPvHealthIndices.get(0).getPointName() + "连续"+content+"健康指数<"+num );
...@@ -782,7 +782,7 @@ public class HealthStatusIndicatorServiceImpl { ...@@ -782,7 +782,7 @@ public class HealthStatusIndicatorServiceImpl {
idxBizFanWarningRecord.setIndexAddress(address); idxBizFanWarningRecord.setIndexAddress(address);
idxBizFanWarningRecord.setEquipmentName(idxBizFanHealthIndices.get(0).getEquipmentName()); idxBizFanWarningRecord.setEquipmentName(idxBizFanHealthIndices.get(0).getEquipmentName());
idxBizFanWarningRecord.setAnalysisPointId(idxBizFanHealthIndices.get(0).getAnalysisObjSeq()); idxBizFanWarningRecord.setAnalysisPointId(idxBizFanHealthIndices.get(0).getAnalysisObjSeq());
idxBizFanWarningRecord.setDisposotionState("未处置"); idxBizFanWarningRecord.setDisposotionState("待确认");
idxBizFanWarningRecord.setStatus("0"); idxBizFanWarningRecord.setStatus("0");
idxBizFanWarningRecord.setWarningName(level); idxBizFanWarningRecord.setWarningName(level);
idxBizFanWarningRecord.setCONTENT(idxBizFanHealthIndices.get(0).getPointName() + "连续"+content+"健康指数<"+num ); idxBizFanWarningRecord.setCONTENT(idxBizFanHealthIndices.get(0).getPointName() + "连续"+content+"健康指数<"+num );
...@@ -950,7 +950,7 @@ public class HealthStatusIndicatorServiceImpl { ...@@ -950,7 +950,7 @@ public class HealthStatusIndicatorServiceImpl {
idxBizFanWarningRecord.setIndexAddress(address); idxBizFanWarningRecord.setIndexAddress(address);
idxBizFanWarningRecord.setEquipmentName(idxBizFanHealthIndices.get(0).getEquipmentName()); idxBizFanWarningRecord.setEquipmentName(idxBizFanHealthIndices.get(0).getEquipmentName());
idxBizFanWarningRecord.setAnalysisPointId(idxBizFanHealthIndices.get(0).getAnalysisObjSeq()); idxBizFanWarningRecord.setAnalysisPointId(idxBizFanHealthIndices.get(0).getAnalysisObjSeq());
idxBizFanWarningRecord.setDisposotionState("未处置"); idxBizFanWarningRecord.setDisposotionState("待确认");
idxBizFanWarningRecord.setStatus("0"); idxBizFanWarningRecord.setStatus("0");
idxBizFanWarningRecord.setWarningName(level); idxBizFanWarningRecord.setWarningName(level);
idxBizFanWarningRecord.setCONTENT(idxBizFanHealthIndices.get(0).getPointName() + "连续"+content+"健康指数<"+num ); idxBizFanWarningRecord.setCONTENT(idxBizFanHealthIndices.get(0).getPointName() + "连续"+content+"健康指数<"+num );
...@@ -1121,7 +1121,7 @@ public class HealthStatusIndicatorServiceImpl { ...@@ -1121,7 +1121,7 @@ public class HealthStatusIndicatorServiceImpl {
idxBizFanWarningRecord.setIndexAddress(address); idxBizFanWarningRecord.setIndexAddress(address);
idxBizFanWarningRecord.setEquipmentName(idxBizFanHealthIndices.get(0).getEquipmentName()); idxBizFanWarningRecord.setEquipmentName(idxBizFanHealthIndices.get(0).getEquipmentName());
idxBizFanWarningRecord.setAnalysisPointId(idxBizFanHealthIndices.get(0).getAnalysisObjSeq()); idxBizFanWarningRecord.setAnalysisPointId(idxBizFanHealthIndices.get(0).getAnalysisObjSeq());
idxBizFanWarningRecord.setDisposotionState("未处置"); idxBizFanWarningRecord.setDisposotionState("待确认");
idxBizFanWarningRecord.setStatus("0"); idxBizFanWarningRecord.setStatus("0");
idxBizFanWarningRecord.setWarningName(level); idxBizFanWarningRecord.setWarningName(level);
idxBizFanWarningRecord.setCONTENT(idxBizFanHealthIndices.get(0).getPointName() + "连续"+content+"健康指数<"+num ); idxBizFanWarningRecord.setCONTENT(idxBizFanHealthIndices.get(0).getPointName() + "连续"+content+"健康指数<"+num );
......
...@@ -13,6 +13,8 @@ import com.yeejoin.amos.boot.module.jxiop.biz.tdmapper.IndicatorDataMapper; ...@@ -13,6 +13,8 @@ import com.yeejoin.amos.boot.module.jxiop.biz.tdmapper.IndicatorDataMapper;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.typroject.tyboot.core.rdbms.service.BaseService; import org.typroject.tyboot.core.rdbms.service.BaseService;
import java.text.DecimalFormat;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.*; import java.util.*;
...@@ -69,7 +71,7 @@ public class IdxBizFanHealthIndexServiceImpl extends BaseService<IdxBizFanHealth ...@@ -69,7 +71,7 @@ public class IdxBizFanHealthIndexServiceImpl extends BaseService<IdxBizFanHealth
} }
public final DecimalFormat dfSS = new DecimalFormat("0.00");
public Object getqyt(String type,String address,String statioName,String equipmentName, String arae,String startTime,String endTime){ public Object getqyt(String type,String address,String statioName,String equipmentName, String arae,String startTime,String endTime){
Map<String, Object> map = new HashMap<>(); Map<String, Object> map = new HashMap<>();
...@@ -120,7 +122,7 @@ public class IdxBizFanHealthIndexServiceImpl extends BaseService<IdxBizFanHealth ...@@ -120,7 +122,7 @@ public class IdxBizFanHealthIndexServiceImpl extends BaseService<IdxBizFanHealth
List<String> axisData = new ArrayList<>(); List<String> axisData = new ArrayList<>();
List<String> activePowers = new ArrayList<>(); List<String> activePowers = new ArrayList<>();
for (int i = 0; i < indicatorDataListActivePowers.size(); i++) { for (int i = 0; i < indicatorDataListActivePowers.size(); i++) {
activePowers.add(indicatorDataListActivePowers.get(i).getValue()); activePowers.add(dfSS.format(indicatorDataListActivePowers.get(i).getValueF()));
axisData.add(DateUtil.format(indicatorDataListActivePowers.get(i).getCreatedTime(), "yyyy-MM-dd HH:mm:ss")); axisData.add(DateUtil.format(indicatorDataListActivePowers.get(i).getCreatedTime(), "yyyy-MM-dd HH:mm:ss"));
} }
// List<Map<String, Object>> seriesData = new ArrayList<>(); // List<Map<String, Object>> seriesData = new ArrayList<>();
......
...@@ -48,7 +48,7 @@ public interface IndicatorDataMapper extends BaseMapper<IndicatorData> { ...@@ -48,7 +48,7 @@ public interface IndicatorDataMapper extends BaseMapper<IndicatorData> {
List<IndicatorData> selectByIndexNameAndDate(@Param("equipmentIndexName") String equipmentIndexName, @Param("gatewayId") String gatewayId, @Param("date") String date, @Param("limitNum") Integer limitNum); List<IndicatorData> selectByIndexNameAndDate(@Param("equipmentIndexName") String equipmentIndexName, @Param("gatewayId") String gatewayId, @Param("date") String date, @Param("limitNum") Integer limitNum);
@Select("select `value`, created_time from iot_data.indicator_data where id =#{id} and ts >= #{startTime} and ts <= #{endTime} ") @Select("select `value_f` as valueF, created_time from iot_data.indicator_data where id =#{id} and ts >= #{startTime} and ts <= #{endTime} ")
List<IndicatorData> selectDataByequipmentIndexNameAndtimeAndEquipmentNumber(@Param("id") String id, @Param("startTime") String startTime, @Param("endTime") String endTime); List<IndicatorData> selectDataByequipmentIndexNameAndtimeAndEquipmentNumber(@Param("id") String id, @Param("startTime") String startTime, @Param("endTime") String endTime);
@Select("select `value`,`value_f`, address, gateway_id from iot_data.indicator_data where ts > NOW()-10m and gateway_id = #{gatewayId}") @Select("select `value`,`value_f`, address, gateway_id from iot_data.indicator_data where ts > NOW()-10m and gateway_id = #{gatewayId}")
......
...@@ -46,7 +46,7 @@ ...@@ -46,7 +46,7 @@
idx_biz_fan_warning_record idx_biz_fan_warning_record
) a ) a
<where> <where>
((a.disposotionState = '未处置') or (a.disposotionState = '已处置' AND a.disposotionDate > DATE_ADD( now(), INTERVAL - 3 DAY ))) ((a.disposotionState = '待确认') or (a.disposotionState = '已确认' AND a.disposotionDate > DATE_ADD( now(), INTERVAL - 3 DAY )))
<if test="arae != '' and arae != null"> <if test="arae != '' and arae != null">
AND a.arae like concat('%', #{arae}, '%') AND a.arae like concat('%', #{arae}, '%')
</if> </if>
...@@ -107,7 +107,7 @@ ...@@ -107,7 +107,7 @@
idx_biz_fan_warning_record idx_biz_fan_warning_record
) a ) a
<where> <where>
((a.disposotionState = '未处置') or (a.disposotionState = '已处置' AND a.disposotionDate > DATE_ADD( now(), INTERVAL - 3 DAY ))) ((a.disposotionState = '待确认') or (a.disposotionState = '已确认' AND a.disposotionDate > DATE_ADD( now(), INTERVAL - 3 DAY )))
<if test="arae != '' and arae != null"> <if test="arae != '' and arae != null">
AND a.arae like concat('%', #{arae}, '%') AND a.arae like concat('%', #{arae}, '%')
</if> </if>
......
...@@ -244,8 +244,8 @@ ...@@ -244,8 +244,8 @@
from from
analysis_data.fan_warning_record analysis_data.fan_warning_record
<where> <where>
((disposotion_state = '未处置') ((disposotion_state = '待确认')
or (disposotion_state = '已处置' or (disposotion_state = '已确认'
and ts > now - 3d - 8h)) and ts > now - 3d - 8h))
<if test="stationCode != null and stationCode != ''"> <if test="stationCode != null and stationCode != ''">
and gateway_id = #{stationCode} and gateway_id = #{stationCode}
...@@ -256,9 +256,9 @@ ...@@ -256,9 +256,9 @@
warning_name as warningName warning_name as warningName
from from
analysis_data.pv_warning_record analysis_data.pv_warning_record
<where>((disposotion_state = '未处置') <where>((disposotion_state = '待确认')
or ( or (
disposotion_state = '已处置' disposotion_state = '已确认'
and ts > now - 3d - 8h )) and ts > now - 3d - 8h ))
<if test="stationCode != null and stationCode != ''"> <if test="stationCode != null and stationCode != ''">
and gateway_id = #{stationCode} and gateway_id = #{stationCode}
...@@ -277,7 +277,7 @@ ...@@ -277,7 +277,7 @@
FROM FROM
fan_warning_record fan_warning_record
<where> <where>
disposotion_state = '未处置' disposotion_state = '待确认'
<if test="subSystem != null and subSystem != ''"> <if test="subSystem != null and subSystem != ''">
AND sub_system = #{subSystem} AND sub_system = #{subSystem}
</if> </if>
...@@ -299,7 +299,7 @@ ...@@ -299,7 +299,7 @@
${tableName} ${tableName}
WHERE WHERE
index_address = #{indexAddress} index_address = #{indexAddress}
AND disposotion_state = '未处置' AND disposotion_state = '待确认'
and gateway_id = #{fanGatewayId} and gateway_id = #{fanGatewayId}
ORDER BY ORDER BY
ts DESC ts DESC
...@@ -329,7 +329,7 @@ ...@@ -329,7 +329,7 @@
FROM FROM
pv_warning_record pv_warning_record
<where> <where>
disposotion_state = '未处置' disposotion_state = '待确认'
<if test="equipmentName != null and equipmentName != ''"> <if test="equipmentName != null and equipmentName != ''">
AND equipment_name = #{equipmentName} AND equipment_name = #{equipmentName}
</if> </if>
......
...@@ -273,8 +273,8 @@ ...@@ -273,8 +273,8 @@
warning_name as warningName, warning_name as warningName,
count(1) as num count(1) as num
from analysis_data.fan_warning_record a from analysis_data.fan_warning_record a
where (a.disposotion_state = '未处置') where (a.disposotion_state = '待确认')
or (a.disposotion_state = '已处置' and a.ts >(now()-3d -8h )) or (a.disposotion_state = '已确认' and a.ts >(now()-3d -8h ))
group by arae, group by arae,
warning_name warning_name
...@@ -325,7 +325,7 @@ ...@@ -325,7 +325,7 @@
analysis_data.fan_warning_record analysis_data.fan_warning_record
) a ) a
<where> <where>
( (a.disposotionstate = '未处置') or (a.disposotionstate = '已处置' and a.ts >( now()- 3d - 8h ))) ( (a.disposotionstate = '待确认') or (a.disposotionstate = '已确认' and a.ts >( now()- 3d - 8h )))
<if test="arae != '' and arae != null"> <if test="arae != '' and arae != null">
and a.arae like #{arae} and a.arae like #{arae}
</if> </if>
...@@ -389,8 +389,8 @@ ...@@ -389,8 +389,8 @@
analysis_data.fan_warning_record analysis_data.fan_warning_record
) a ) a
<where> <where>
( a.disposotionState = '未处置' ( a.disposotionState = '待确认'
or (a.disposotionState = '已处置' and a.ts > ( now() - 3D - 8h ))) or (a.disposotionState = '已确认' and a.ts > ( now() - 3D - 8h )))
<if test="arae != '' and arae != null"> <if test="arae != '' and arae != null">
and a.arae like #{arae} and a.arae like #{arae}
</if> </if>
...@@ -540,8 +540,8 @@ ...@@ -540,8 +540,8 @@
count(1) as num, count(1) as num,
station station
from analysis_data.fan_warning_record a from analysis_data.fan_warning_record a
where (a.disposotion_state = '未处置') where (a.disposotion_state = '待确认')
or (a.disposotion_state = '已处置' and a.ts >(now()-3d -8h )) or (a.disposotion_state = '已确认' and a.ts >(now()-3d -8h ))
group by arae, group by arae,
warning_name,station warning_name,station
union all union all
...@@ -550,8 +550,8 @@ ...@@ -550,8 +550,8 @@
count(1) as num, count(1) as num,
station station
from analysis_data.pv_warning_record a from analysis_data.pv_warning_record a
where (a.disposotion_state = '未处置') where (a.disposotion_state = '待确认')
or (a.disposotion_state = '已处置' and a.ts >(now()-3d -8h )) or (a.disposotion_state = '已确认' and a.ts >(now()-3d -8h ))
group by arae, group by arae,
warning_name,station ) b warning_name,station ) b
<where> <where>
......
...@@ -291,8 +291,8 @@ ...@@ -291,8 +291,8 @@
warning_name as warningName, warning_name as warningName,
count(1) as num count(1) as num
from analysis_data.pv_warning_record a from analysis_data.pv_warning_record a
where (a.disposotion_state = '未处置') where (a.disposotion_state = '待确认')
or (a.disposotion_state = '已处置' and a.ts >(now()-3d -8h )) or (a.disposotion_state = '已确认' and a.ts >(now()-3d -8h ))
group by arae, group by arae,
warning_name warning_name
......
...@@ -217,7 +217,10 @@ ...@@ -217,7 +217,10 @@
ifnull(c.station_name, '') AS stationName, ifnull(c.station_name, '') AS stationName,
ifnull(a.rec_date, '') as recDate, ifnull(a.rec_date, '') as recDate,
a.sequence_nbr as objectId, a.sequence_nbr as objectId,
b.project_name as unitName b.project_name as unitName,
case when a.qrcode_color = 'red' then 1
when a.qrcode_color = 'yellow' then 2
else 3 end as sort
FROM FROM
person_basic a person_basic a
INNER JOIN station_basic c ON a.project_org_code = c.project_org_code INNER JOIN station_basic c ON a.project_org_code = c.project_org_code
...@@ -237,7 +240,7 @@ ...@@ -237,7 +240,7 @@
AND a.qrcode_color != #{ne} AND a.qrcode_color != #{ne}
</if> </if>
</where> </where>
ORDER BY a.rec_date DESC ORDER BY sort asc,a.rec_date DESC
limit #{current},#{size} limit #{current},#{size}
</select> </select>
......
...@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; ...@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.feign.AmosFeignService; import com.yeejoin.amos.boot.biz.common.feign.AmosFeignService;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils; import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.boot.module.jxiop.api.Enum.QrcodeColorEnum; import com.yeejoin.amos.boot.module.jxiop.api.Enum.QrcodeColorEnum;
import com.yeejoin.amos.boot.module.jxiop.api.dto.CustomizeItems;
import com.yeejoin.amos.boot.module.jxiop.api.dto.PersonBasicDto; import com.yeejoin.amos.boot.module.jxiop.api.dto.PersonBasicDto;
import com.yeejoin.amos.boot.module.jxiop.api.dto.RiskBizInfoVo; import com.yeejoin.amos.boot.module.jxiop.api.dto.RiskBizInfoVo;
import com.yeejoin.amos.boot.module.jxiop.api.dto.RiskDynamicDetailsVo; import com.yeejoin.amos.boot.module.jxiop.api.dto.RiskDynamicDetailsVo;
...@@ -79,7 +80,7 @@ public class PersonBasicServiceImpl extends BaseService<PersonBasicDto, PersonBa ...@@ -79,7 +80,7 @@ public class PersonBasicServiceImpl extends BaseService<PersonBasicDto, PersonBa
PersonAccountFedMapper personAccountFedMapper; PersonAccountFedMapper personAccountFedMapper;
public RiskBizInfoVo fetchData(PersonBasic personBasic, PersonAccount personAccount) { public RiskBizInfoVo fetchData(PersonBasic personBasic, PersonAccount personAccount, String content) {
RiskBizInfoVo riskBizInfoVo = new RiskBizInfoVo(); RiskBizInfoVo riskBizInfoVo = new RiskBizInfoVo();
riskBizInfoVo.setWarningObjectName(personAccount.getProjectName() + personBasic.getPostName() + personAccount.getName()); riskBizInfoVo.setWarningObjectName(personAccount.getProjectName() + personBasic.getPostName() + personAccount.getName());
riskBizInfoVo.setWarningObjectCode(String.valueOf(personBasic.getSequenceNbr())); riskBizInfoVo.setWarningObjectCode(String.valueOf(personBasic.getSequenceNbr()));
...@@ -91,6 +92,9 @@ public class PersonBasicServiceImpl extends BaseService<PersonBasicDto, PersonBa ...@@ -91,6 +92,9 @@ public class PersonBasicServiceImpl extends BaseService<PersonBasicDto, PersonBa
dynamicDetailsVo.setTabName("预警详情"); dynamicDetailsVo.setTabName("预警详情");
detailsVos.add(dynamicDetailsVo); detailsVos.add(dynamicDetailsVo);
riskBizInfoVo.setDynamicDetails(detailsVos); riskBizInfoVo.setDynamicDetails(detailsVos);
CustomizeItems customizeItems = new CustomizeItems();
customizeItems.setWarningContent(content);
riskBizInfoVo.setCustomizeItems(customizeItems);
return riskBizInfoVo; return riskBizInfoVo;
} }
......
...@@ -66,8 +66,7 @@ public class PersonYardTimeTask { ...@@ -66,8 +66,7 @@ public class PersonYardTimeTask {
private StationBasicMapper stationBasicMapper; private StationBasicMapper stationBasicMapper;
@Scheduled(cron = "${person.yard.cron:0 0 0 1/1 * ?}")
@Scheduled(cron = "0 0 0 1/1 * ? ")
public void timeYardTimeTask() { public void timeYardTimeTask() {
if (!redisUtils.hasKey(Constants.JXIOP_DICT_POST) || !redisUtils.hasKey(Constants.JXIOP_DICT_CERTIFICATES)) { if (!redisUtils.hasKey(Constants.JXIOP_DICT_POST) || !redisUtils.hasKey(Constants.JXIOP_DICT_CERTIFICATES)) {
personBasicService.addRedisPostAndCerInfo(); personBasicService.addRedisPostAndCerInfo();
...@@ -103,7 +102,10 @@ public class PersonYardTimeTask { ...@@ -103,7 +102,10 @@ public class PersonYardTimeTask {
//人员资质信息 //人员资质信息
Integer isInMonth = 0; Integer isInMonth = 0;
Integer isOver = 0; Integer isOver = 0;
// 过期的证书
List<String> overCertificateList = new ArrayList<>();
// 临期证书
List<String> inMonthCertificateList = new ArrayList<>();
if (CollectionUtils.isNotEmpty(personCertificateList)) { if (CollectionUtils.isNotEmpty(personCertificateList)) {
for (PersonCertificate item : personCertificateList) { for (PersonCertificate item : personCertificateList) {
int validPeriod = StringUtils.isEmpty(item.getValidPeriod()) ? 3 : Integer.parseInt(item.getValidPeriod()); int validPeriod = StringUtils.isEmpty(item.getValidPeriod()) ? 3 : Integer.parseInt(item.getValidPeriod());
...@@ -111,12 +113,14 @@ public class PersonYardTimeTask { ...@@ -111,12 +113,14 @@ public class PersonYardTimeTask {
if (list.contains(item.getCertificateName()) && if (list.contains(item.getCertificateName()) &&
DateUtils.dateCompare(date, new Date()) == -1) { DateUtils.dateCompare(date, new Date()) == -1) {
isOver = 1; isOver = 1;
overCertificateList.add(item.getCertificateName());
} }
try { try {
if (list.contains(item.getCertificateName()) && if (list.contains(item.getCertificateName()) &&
DateUtils.dateBetweenIncludeToday(new Date(), date) < Integer.valueOf(certificatesMap.get(item.getCertificateName())) && DateUtils.dateBetweenIncludeToday(new Date(), date) < Integer.valueOf(certificatesMap.get(item.getCertificateName())) &&
DateUtils.dateCompare(date, new Date()) == 1) { DateUtils.dateCompare(date, new Date()) == 1) {
isInMonth = 1; isInMonth = 1;
inMonthCertificateList.add(item.getCertificateName());
} }
} catch (ParseException e) { } catch (ParseException e) {
e.printStackTrace(); e.printStackTrace();
...@@ -124,44 +128,71 @@ public class PersonYardTimeTask { ...@@ -124,44 +128,71 @@ public class PersonYardTimeTask {
list.remove(item.getCertificateName()); list.remove(item.getCertificateName());
} }
} }
String qrcodeDescOld = personBasic.getQrcodeDesc();
// 缺证
List<String> noCertificateList = new ArrayList<>(list);
List<String> strings = new ArrayList<>();
if (CollectionUtils.isNotEmpty(overCertificateList)) {
strings.add("过期证书:" + String.join("," , overCertificateList));
}
if (CollectionUtils.isNotEmpty(inMonthCertificateList)) {
strings.add("临期证书:" + String.join("," , inMonthCertificateList));
}
if (CollectionUtils.isNotEmpty(noCertificateList)) {
strings.add("缺少证书:" + String.join("," , noCertificateList));
}
String join = "";
if (CollectionUtils.isNotEmpty(strings)) {
join = String.join(";", strings);
}
String missingCertificateOld = personBasic.getMissingCertificate();
personBasic.setMissingCertificate(join);
String qrcodeColorOld = personBasic.getQrcodeColor(); String qrcodeColorOld = personBasic.getQrcodeColor();
if (CollectionUtils.isEmpty(list) && isInMonth == 0 && isOver == 0) { if (CollectionUtils.isEmpty(list) && isInMonth == 0 && isOver == 0) {
personBasic.setQrcodeColor(QrcodeColorEnum.GREEN.getCode()); personBasic.setQrcodeColor(QrcodeColorEnum.GREEN.getCode());
personBasic.setQrcodeDesc("证书齐全"); personBasic.setQrcodeDesc("证书齐全");
} else if (CollectionUtils.isEmpty(list) && isOver == 1) { personBasic.setQrcodeDate(new Date());
} else if ((CollectionUtils.isEmpty(list) && isOver == 1) || (CollectionUtils.isNotEmpty(list))) {
personBasic.setQrcodeColor(QrcodeColorEnum.RED.getCode());
personBasic.setQrcodeDesc("证书不全"); personBasic.setQrcodeDesc("证书不全");
personBasic.setQrcodeDate(new Date());
} else if (CollectionUtils.isEmpty(list) && isOver == 0 && isInMonth == 1) { } else if (CollectionUtils.isEmpty(list) && isOver == 0 && isInMonth == 1) {
personBasic.setQrcodeColor(QrcodeColorEnum.YELLOW.getCode());
personBasic.setQrcodeDesc("证书临期"); personBasic.setQrcodeDesc("证书临期");
personBasic.setQrcodeDate(new Date());
} }
if (StringUtils.isEmpty(qrcodeDescOld) || !qrcodeDescOld.equals(personBasic.getQrcodeDesc())) { if (!join.equals(missingCertificateOld)) {
personBasic.setRecDate(new Date()); personBasic.setRecDate(new Date());
personBasicService.updateById(personBasic); this.personBasicMapper.updateById(personBasic);
if (("证书不全".equals(personBasic.getQrcodeDesc()) || if (("证书不全".equals(personBasic.getQrcodeDesc()) ||
"证书临期".equals(personBasic.getQrcodeDesc()))) { "证书临期".equals(personBasic.getQrcodeDesc()))) {
BizMessage bizMessage = new BizMessage(); BizMessage bizMessage = new BizMessage();
bizMessage.setIndexKey("RYFM"); bizMessage.setIndexKey("RYFM");
bizMessage.setIndexValue(personBasic.getPostName() + personBasic.getQrcodeDesc()); bizMessage.setIndexValue(personBasic.getPostName() + personBasic.getQrcodeDesc());
RiskBizInfoVo riskBizInfoVo = personBasicService.fetchData(personBasic, personAccount); RiskBizInfoVo riskBizInfoVo = personBasicService.fetchData(personBasic, personAccount, join);
bizMessage.setBizInfo(riskBizInfoVo); bizMessage.setBizInfo(riskBizInfoVo);
bizMessage.setDataSource("人员赋码");
try { try {
emqKeeper.getMqttClient().publish(PersonBasicServiceImpl.RYFM_DATA_MQTT_TOPIC, JSON.toJSONString(bizMessage).getBytes(StandardCharsets.UTF_8), 2, false); emqKeeper.getMqttClient().publish(PersonBasicServiceImpl.RYFM_DATA_MQTT_TOPIC, JSON.toJSONString(bizMessage).getBytes(StandardCharsets.UTF_8), 2, false);
} catch (MqttException e) { } catch (MqttException e) {
e.printStackTrace(); e.printStackTrace();
} }
} } else if ("证书齐全".equals(personBasic.getQrcodeDesc())) {
} else if ("证书齐全".equals(personBasic.getQrcodeDesc())) { HashMap<String, String> personMap = new HashMap<>();
HashMap<String, String> personMap = new HashMap<>(); personMap.put("objectId", String.valueOf(personBasic.getSequenceNbr()));
personMap.put("objectId", String.valueOf(personBasic.getSequenceNbr())); personMap.put("qrCodeColor", qrcodeColorOld);
personMap.put("qrCodeColor", qrcodeColorOld); personMap.put("warningObjectType", "RYFM");
personMap.put("warningObjectType", "RYFM"); personMap.put("sourceAttribution", personBasic.getProjectOrgCode());
personMap.put("sourceAttribution", personBasic.getProjectOrgCode()); personMap.put("sourceAttributionDesc", personAccount.getProjectName());
personMap.put("sourceAttributionDesc", personAccount.getProjectName()); personMap.put("warningSourceType", "人员赋码");
try { try {
emqKeeper.getMqttClient().publish(PersonBasicServiceImpl.RYFM_GREEN, JSON.toJSONString(personMap).getBytes(StandardCharsets.UTF_8), 2, false); emqKeeper.getMqttClient().publish(PersonBasicServiceImpl.RYFM_GREEN, JSON.toJSONString(personMap).getBytes(StandardCharsets.UTF_8), 2, false);
} catch (MqttException e) { } catch (MqttException e) {
e.printStackTrace(); e.printStackTrace();
}
} }
} }
}); });
......
...@@ -102,7 +102,10 @@ ...@@ -102,7 +102,10 @@
ifnull(a.QRCODE_COLOR, '') AS qrCodeColor, ifnull(a.QRCODE_COLOR, '') AS qrCodeColor,
ifnull(b.COMPANY_NAME, '') AS stationName, ifnull(b.COMPANY_NAME, '') AS stationName,
ifnull(a.UPDATE_STAMP, '') as recDate, ifnull(a.UPDATE_STAMP, '') as recDate,
a.SBBM as objectId a.SBBM as objectId,
(case when a.QRCODE_COLOR = 'red' then 1
when a.QRCODE_COLOR = 'yellow' then 2
else 3 end) as sort
FROM FROM
sjgl_zsj_zsbtz a sjgl_zsj_zsbtz a
INNER JOIN privilege_company b ON a.WERKS = b.COMPANY_CODE and b.IS_DELETED = false AND b.`LEVEL` = 'station' INNER JOIN privilege_company b ON a.WERKS = b.COMPANY_CODE and b.IS_DELETED = false AND b.`LEVEL` = 'station'
...@@ -120,7 +123,7 @@ ...@@ -120,7 +123,7 @@
AND a.QRCODE_COLOR != #{ne} AND a.QRCODE_COLOR != #{ne}
</if> </if>
</where> </where>
ORDER BY a.UPDATE_STAMP DESC ORDER BY sort asc, a.UPDATE_STAMP DESC
limit #{current},#{size} limit #{current},#{size}
</select> </select>
...@@ -153,7 +156,10 @@ ...@@ -153,7 +156,10 @@
ifnull(b.COMPANY_NAME, '') AS stationName, ifnull(b.COMPANY_NAME, '') AS stationName,
ifnull(a.CREATE_TIME, '') as recDate, ifnull(a.CREATE_TIME, '') as recDate,
a.DBID AS objectId, a.DBID AS objectId,
c.SBBM as jobId c.SBBM as jobId,
case when a.QRCODE_COLOR = 'red' then 1
when a.QRCODE_COLOR = 'yellow' then 2
else 3 end as sort
FROM FROM
fdgl_job_main a fdgl_job_main a
INNER JOIN privilege_company b ON a.WERKS = b.COMPANY_CODE and b.IS_DELETED = false AND b.`LEVEL` = 'station' INNER JOIN privilege_company b ON a.WERKS = b.COMPANY_CODE and b.IS_DELETED = false AND b.`LEVEL` = 'station'
...@@ -172,7 +178,7 @@ ...@@ -172,7 +178,7 @@
AND a.QRCODE_COLOR != #{ne} AND a.QRCODE_COLOR != #{ne}
</if> </if>
</where> </where>
ORDER BY a.CREATE_TIME DESC ORDER BY sort asc, a.CREATE_TIME DESC
limit #{current},#{size} limit #{current},#{size}
</select> </select>
......
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