Commit 3deaa132 authored by 张森's avatar 张森

Merge remote-tracking branch 'origin/develop_dl' into develop_dl_4.0

parents 4627f6b2 38b09d63
...@@ -1191,7 +1191,29 @@ LEFT JOIN ( ...@@ -1191,7 +1191,29 @@ LEFT JOIN (
cf.certificate_number certificatesNumber, cf.certificate_number certificatesNumber,
( SELECT field_value FROM cb_dynamic_form_instance dfi WHERE dfi.field_code = 'personNumber' AND dfi.instance_id = u.sequence_nbr ) AS employee_number, ( SELECT field_value FROM cb_dynamic_form_instance dfi WHERE dfi.field_code = 'personNumber' AND dfi.instance_id = u.sequence_nbr ) AS employee_number,
( SELECT field_value FROM cb_dynamic_form_instance dfi WHERE dfi.field_code = 'telephone' AND dfi.instance_id = u.sequence_nbr ) AS telephone, ( SELECT field_value FROM cb_dynamic_form_instance dfi WHERE dfi.field_code = 'telephone' AND dfi.instance_id = u.sequence_nbr ) AS telephone,
( CASE WHEN cfp.post_qualification IS NULL or cfp.post_qualification = '' THEN 0 ELSE 1 END ) AS is_certificate, CASE
WHEN ( SELECT field_value FROM cb_dynamic_form_instance dfi WHERE dfi.field_code = 'peopleType' AND dfi.instance_id = u.sequence_nbr ) = 1602 THEN
(
IF
((
SELECT
concat( cfp.post_qualification_code, ',' ) REGEXP concat( REPLACE ( '1427,1428,1429,1430,1431', ',', ',|' ), ',' )) > 0,
1,
0
)
)
WHEN ( SELECT field_value FROM cb_dynamic_form_instance dfi WHERE dfi.field_code = 'peopleType' AND dfi.instance_id = u.sequence_nbr ) = 1601 THEN
(
IF
(
(
concat( cfp.post_qualification_code, ',' ) REGEXP concat( REPLACE ( '1823,1824,1825,1826,1827', ',', ',|' ), ',' ) > 0
AND concat( cfp.post_qualification_code, ',' ) REGEXP concat( REPLACE ( '1421,1422,1423,1424,1425', ',', ',|' ), ',' ) > 0
),
1,
0
)) ELSE 0
END AS is_certificate,
IF IF
( (
( SELECT field_value FROM cb_dynamic_form_instance dfi WHERE dfi.field_code = 'peopleType' AND dfi.instance_id = u.sequence_nbr ) = 1601, ( SELECT field_value FROM cb_dynamic_form_instance dfi WHERE dfi.field_code = 'peopleType' AND dfi.instance_id = u.sequence_nbr ) = 1601,
......
...@@ -2531,7 +2531,7 @@ public class MqttReceiveServiceImpl implements MqttReceiveService { ...@@ -2531,7 +2531,7 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
EquipmentSpecificIndex equipmentSpecificIndex = new EquipmentSpecificIndex(); EquipmentSpecificIndex equipmentSpecificIndex = new EquipmentSpecificIndex();
String prefix = null; String prefix = null;
String suffix = null; String suffix = null;
if (iotCode.length() > 8) { if (!StringUtils.isEmpty(iotCode) && iotCode.length() > 8) {
prefix = iotCode.substring(0, 8); prefix = iotCode.substring(0, 8);
suffix = iotCode.substring(8); suffix = iotCode.substring(8);
} else { } else {
......
...@@ -4,6 +4,8 @@ import org.springframework.beans.BeanUtils; ...@@ -4,6 +4,8 @@ import org.springframework.beans.BeanUtils;
import org.springframework.beans.BeanWrapper; import org.springframework.beans.BeanWrapper;
import org.springframework.beans.BeanWrapperImpl; import org.springframework.beans.BeanWrapperImpl;
import liquibase.util.StringUtil;
import java.util.HashSet; import java.util.HashSet;
import java.util.Set; import java.util.Set;
...@@ -33,6 +35,11 @@ public class BeanUtil { ...@@ -33,6 +35,11 @@ public class BeanUtil {
public static boolean judgePropertyContainsChar(String sourceStr, String specialStr) { public static boolean judgePropertyContainsChar(String sourceStr, String specialStr) {
boolean bool = Boolean.FALSE; boolean bool = Boolean.FALSE;
if(StringUtil.isEmpty(sourceStr) || StringUtil.isEmpty(specialStr)){
return bool;
}
specialStr = specialStr.trim();
sourceStr = sourceStr.trim();
String[] strings = specialStr.split(","); String[] strings = specialStr.split(",");
for (String code : strings) { for (String code : strings) {
if (sourceStr.contains(code)) { if (sourceStr.contains(code)) {
......
...@@ -76,10 +76,12 @@ public class KafkaConsumerService implements ApplicationRunner { ...@@ -76,10 +76,12 @@ public class KafkaConsumerService implements ApplicationRunner {
public void kafkaListener(ConsumerRecord<?, String> record, Acknowledgment ack) { public void kafkaListener(ConsumerRecord<?, String> record, Acknowledgment ack) {
try { try {
Optional<?> messages = Optional.ofNullable(record.value()); Optional<?> messages = Optional.ofNullable(record.value());
log.info("kafka上报数据:{}", record.toString());
if (messages.isPresent()) { if (messages.isPresent()) {
JSONObject object = JSONObject.fromObject(record.value()); JSONObject object = JSONObject.fromObject(record.value());
com.alibaba.fastjson.JSONObject jsonObj = ClassToJsonUtil.class2json(object, commonMessage, record.topic()); com.alibaba.fastjson.JSONObject jsonObj = ClassToJsonUtil.class2json(object, commonMessage, record.topic());
if ((StringUtils.isEmpty(filePath)) || (CollectionUtils.isEmpty(codeListInfo)) || (!ObjectUtils.isEmpty(jsonObj) && Boolean.TRUE.equals(isSendEmq(jsonObj)))) { if ((StringUtils.isEmpty(filePath)) || (CollectionUtils.isEmpty(codeListInfo)) || (!ObjectUtils.isEmpty(jsonObj) && Boolean.TRUE.equals(isSendEmq(jsonObj)))) {
log.info("kafka上报mqtt数据:{}", JSON.toJSONString(jsonObj));
emqKeeper.getMqttClient().publish(String.valueOf(jsonObj.get("mqTopic")), JSON.toJSONString(jsonObj).getBytes("UTF-8"), 0, false); emqKeeper.getMqttClient().publish(String.valueOf(jsonObj.get("mqTopic")), JSON.toJSONString(jsonObj).getBytes("UTF-8"), 0, false);
} }
} }
...@@ -92,25 +94,6 @@ public class KafkaConsumerService implements ApplicationRunner { ...@@ -92,25 +94,6 @@ public class KafkaConsumerService implements ApplicationRunner {
} }
} }
@KafkaListener(id = "kafkaConsumerEventAlarm", groupId = "kafkaConsumerGroupEventAlarm", topics = "#{'${queue.kafka.eventAlarm.topics}'.split(',')}", containerFactory = "kafkaRomaContainerFactory")
public void kafkaConsumerEventAlarm(ConsumerRecord<?, String> record, Acknowledgment ack) {
Optional<?> message = Optional.ofNullable(record.value());
if (message.isPresent()) {
try {
JSONObject object = JSONObject.fromObject(record.value());
com.alibaba.fastjson.JSONObject jsonObj = ClassToJsonUtil.class2json(object, commonMessage, record.topic());
if ((StringUtils.isEmpty(filePath)) || (CollectionUtils.isEmpty(codeListInfo)) || (!ObjectUtils.isEmpty(jsonObj) && Boolean.TRUE.equals(isSendEmq(jsonObj)))) {
emqKeeper.getMqttClient().publish(String.valueOf(jsonObj.get("mqTopic")), JSON.toJSONString(jsonObj).getBytes("UTF-8"), 0, false);
}
ack.acknowledge();
} catch (MqttException e) {
log.error("解析数据失败,{}", e.getMessage());
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
}
}
/** /**
* 消费单条消息,topics 可以监听多个topic,如:topics = {"topic1", "topic2"} * 消费单条消息,topics 可以监听多个topic,如:topics = {"topic1", "topic2"}
* *
......
...@@ -109,10 +109,13 @@ system.zxj=false ...@@ -109,10 +109,13 @@ system.zxj=false
##\u9700\u8981\u76D1\u542C\u5F97eqm\u6D88\u606F\u4E3B\u9898 \u6839\u636E\u662F\u5426\u662F\u4E2D\u5FC3\u6781\u548C\u7AD9\u7AEF\u9009\u62E9\u9700\u8981\u76D1\u542C\u5F97\u4E3B\u9898\u8FDB\u884C\u914D\u7F6E emq.iot.created, ##\u9700\u8981\u76D1\u542C\u5F97eqm\u6D88\u606F\u4E3B\u9898 \u6839\u636E\u662F\u5426\u662F\u4E2D\u5FC3\u6781\u548C\u7AD9\u7AEF\u9009\u62E9\u9700\u8981\u76D1\u542C\u5F97\u4E3B\u9898\u8FDB\u884C\u914D\u7F6E emq.iot.created,
#emq.topic=ccs-user-login-info,sync.execute,data/mcb/warning,emq.risk.qrcode.put,emq.risk.qrcode.clean #emq.topic=ccs-user-login-info,sync.execute,data/mcb/warning,emq.risk.qrcode.put,emq.risk.qrcode.clean
queue.kafka.topics=null # 现场kafka消息 topic 遥测遥信告警都 配在这个配置中(英文逗号隔开即可)
kafka.auto-startup=false # 原告警topic配置删除queue.kafka.eventAlarm.topics
queue.kafka.topics=T_DC_MQ_REALDATA,T_DC_MQ_STATUS
#浜嬩欢鍛婅瀵规帴Kafka涓婚 kafka.auto-startup=false
queue.kafka.eventAlarm.topics=JKXT2BP-GJ-Topic-site
kafka.station.groupId=shaoxing kafka.station.groupId=shaoxing
#F:\\filterExcel11.xlsx 读取excel文件过滤kafka消息 如不需要将该配置置空,或者不添加该配置即可
filter.excel.path=F:\\filterExcel.xlsx
\ No newline at end of file
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