Commit 9ca0695d authored by maoying's avatar maoying

Merge branch 'develop_dl_3.7.0.9' of http://39.98.45.134:8090/moa/amos-boot-biz…

Merge branch 'develop_dl_3.7.0.9' of http://39.98.45.134:8090/moa/amos-boot-biz into develop_dl_3.7.0.9
parents a3e74a0d 305ebf46
......@@ -847,7 +847,9 @@ public class ConfigureController extends AbstractBaseController {
list.forEach(e->
iFireFightingSystemService.iotDayReport(e.get("bizOrgCode"), finalStartDate, finalEndDate)
);
log.info("定时生成 物联报表-日执行结束");
} catch (Exception e) {
log.info("定时生成 物联报表-日执行报错");
e.printStackTrace();
}
return CommonResponseUtil.success();
......
......@@ -62,6 +62,6 @@ public class ApplicationRunnerImpl implements ApplicationRunner {
iSourceStatistics.initAllCategoryStatisticsData(SourceTypeEnum.IOT);
maintenanceResourceDataService.subscribeTopic();
emqKeeper.getMqttClient().subscribe(ConfigPageTopicEnum.INTEGRATE.getTopic(), 2, integratePageDataListener);
emqKeeper.subscript(ConfigPageTopicEnum.INTEGRATE.getTopic(), 2, integratePageDataListener);
}
}
......@@ -214,11 +214,16 @@ public class FormInstanceEquipServiceImpl extends ServiceImpl<FormInstanceEquipM
@Override
@Transactional(rollbackFor = {Exception.class, BaseException.class})
public Object updateForm(Long instanceId, String orgCode, Map<String, Object> map, String groupCode) {
if (com.yeejoin.equipmanage.common.utils.StringUtil.isNotEmpty(groupCode)) {
map.keySet().forEach(x -> {
formInstanceEquipMapper.updateFormFieldValue(instanceId, x, String.valueOf(map.get(x)));
});
return CommonResponseUtil.success();
List<FormInstanceEquip> list = this.queryByInstanceId(instanceId);
if (CollectionUtils.isEmpty(list)) {
saveForm(groupCode, orgCode, map, String.valueOf(instanceId));
} else {
if (com.yeejoin.equipmanage.common.utils.StringUtil.isNotEmpty(groupCode)) {
map.keySet().forEach(x -> {
formInstanceEquipMapper.updateFormFieldValue(instanceId, x, String.valueOf(map.get(x)));
});
return CommonResponseUtil.success();
}
}
return null;
}
......
......@@ -6,6 +6,7 @@ import com.yeejoin.amos.boot.module.jcs.api.dto.AlertNewsDto;
import com.yeejoin.amos.component.rule.config.ClazzUtils;
import com.yeejoin.amos.component.rule.config.RuleConfig;
import org.eclipse.paho.client.mqttv3.MqttException;
import org.eclipse.paho.client.mqttv3.MqttMessage;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -15,6 +16,7 @@ import org.springframework.boot.ApplicationRunner;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;
import org.typroject.tyboot.component.emq.EmqKeeper;
import org.typroject.tyboot.component.emq.EmqxListener;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import java.util.List;
......@@ -43,22 +45,25 @@ public class StartLoader implements ApplicationRunner {
public void loadSysParams(){
try {
emqKeeper.getMqttClient().subscribe(topic, (s, mqttMessage) -> {
byte[] payload = mqttMessage.getPayload();
emqKeeper.subscript(topic, 1, new EmqxListener() {
@Override
public void processMessage(String s, MqttMessage mqttMessage) throws Exception {
byte[] payload = mqttMessage.getPayload();
String obj = new String(payload);
if (!ValidationUtil.isEmpty(obj)) {
JSONObject json = JSON.parseObject(obj);
AlertNewsDto alertNewsDto = new AlertNewsDto( "物联警情",
"物联设备发生警情,发生位置:"+(json.get("address")!=null?json.get("address").toString():"")+
"物联设备发生警情,发生位置:"+(json.get("address")!=null?json.get("address").toString():"")+
",事发单位:"+(json.get("unitInvolvedName")!=null?json.get("unitInvolvedName").toString():"")
+",联系人:"+(json.get("contactUser")!=null?json.get("contactUser").toString():"")
+",联系电话:"+(json.get("contactPhone")!=null?json.get("contactPhone").toString():"")+".请尽快处理!",
json.get("id").toString(), json);
json.get("id").toString(), json);
emqKeeper.getMqttClient().publish(topicweb, JSON.toJSON(alertNewsDto).toString().getBytes("UTF-8"), 1, false);
}
}
}
});
} catch (MqttException e) {
} catch (Exception e) {
logger.info("订阅物联警情异常", e);
}
}
......
......@@ -752,6 +752,23 @@ public class InputItemController extends AbstractBaseController {
map.put("OkScore",param.getOkScore()!=null?param.getOkScore():0);
map.put("NoScore",param.getNoScore()!=null?param.getNoScore():0);
map.put("CheckType",param.getCheckType());
String inputClassify = "";
switch(param.getInputClassify()) {
case "WGJC":
inputClassify = "外观检查";
break;
case "GNCS":
inputClassify = "功能测试";
break;
case "HJJC":
inputClassify = "环境检查";
break;
case "QT":
inputClassify = "其他";
break;
default:
}
inputItem.setInputClassify(inputClassify);
inputItem.setDataJson(JSONObject.toJSONString(map));
}else if(param.getItemType().equals("选择")){
......@@ -771,10 +788,10 @@ public class InputItemController extends AbstractBaseController {
map.put("ValidDown",param.getValidDown()!=null?param.getValidDown():"");
map.put("OkUp",param.getOkUp()!=null?param.getOkUp():"");
map.put("OkDown",param.getOkDown()!=null?param.getOkDown():"");
map.put("CheckValidUp",param.getCheckValidUp().equals("false")?false:true);
map.put("CheckValidDown",param.getCheckValidDown().equals("false")?false:true);
map.put("CheckOkUp",param.getCheckOkUp().equals("false")?false:true);
map.put("CheckOkDown",param.getCheckOkDown().equals("false")?false:true);
map.put("CheckValidUp",param.getCheckValidUp().equals("")?false:true);
map.put("CheckValidDown",param.getCheckValidDown().equals("")?false:true);
map.put("CheckOkUp",param.getCheckOkUp().equals("")?false:true);
map.put("CheckOkDown",param.getCheckOkDown().equals("")?false:true);
map.put("Precision",param.getPrecision()!=null?param.getPrecision():0);
inputItem.setDataJson(JSONObject.toJSONString(map));
}
......
......@@ -74,6 +74,11 @@ public class AmostEquipApplication {
*/
@Bean
void initMqtt() throws MqttException {
emqKeeper.getMqttClient().subscribe("+/+/property", 1, carIotListener);
try {
emqKeeper.subscript("+/+/property", 1, carIotListener);
} catch (Exception e) {
e.printStackTrace();
logger.error("EMQ初始化连接失败!");
}
}
}
......@@ -1410,22 +1410,15 @@
WHERE es.id = #{equipmentSpecificId}
</select>
<delete id="deleteEquipDataBySpecificId">
DELETE es, ed, esi, ves, esr, esa, esal, eard FROM
wl_equipment_specific es
LEFT JOIN wl_equipment_detail ed ON ed.id = es.equipment_detail_id
LEFT JOIN wl_equipment_specific_index esi ON es.id = esi.equipment_specific_id
LEFT JOIN wl_video_equipment_specific ves ON es.id = ves.equipment_specific_id
LEFT JOIN wl_equipment_specific_relation esr ON ed.id = esr.equipment_specific_id
LEFT JOIN wl_equipment_specific_alarm esa ON ed.id = esa.equipment_specific_id
LEFT JOIN wl_equipment_specific_alarm_log esal ON ed.id = esal.equipment_specific_id
LEFT JOIN wl_equipment_alarm_report_day eard ON ed.id = eard.equipment_specific_id
WHERE es.id = #{specificId}
DELETE FROM wl_equipment_specific WHERE id = #{specificId};
DELETE FROM wl_equipment_detail WHERE id = (SELECT equipment_detail_id FROM wl_equipment_specific WHERE id = #{specificId});
DELETE FROM wl_equipment_specific_alarm WHERE equipment_specific_id = #{specificId};
DELETE FROM wl_equipment_specific_alarm_log WHERE equipment_specific_id = #{specificId};
DELETE FROM wl_equipment_alarm_report_day WHERE equipment_specific_id = #{specificId};
DELETE FROM wl_equipment_specific_index WHERE equipment_specific_id = #{specificId};
DELETE FROM wl_video_equipment_specific WHERE equipment_specific_id = #{specificId};
DELETE FROM wl_equipment_specific_relation WHERE equipment_specific_id = #{specificId};
</delete>
<delete id="deleteEquipDataByStockDetailId">
DELETE
......
......@@ -102,8 +102,8 @@ public class PatrolApplication {
@Bean
void initMqtt() {
try {
emqKeeper.getMqttClient().subscribe(patrolTopic, 1, patrolMqttListener);
} catch (MqttException e) {
emqKeeper.subscript(patrolTopic, 1, patrolMqttListener);
} catch (Exception e) {
e.printStackTrace();
logger.error("EMQ初始化连接失败!");
}
......
......@@ -8,3 +8,6 @@ spring.jackson.serialization.write-dates-as-timestamps=true
##代码中有部分逻辑冲突需要处理 为区分机场和电力逻辑 增加开关 若为true 则为机场逻辑 为false 则为电力逻辑
logic=false
logging.config=classpath:logback-${spring.profiles.active}.xml
\ 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