Commit f9e1923f authored by 王鹿鹿's avatar 王鹿鹿

Merge remote-tracking branch 'origin/develop_dl_plan6' into develop_dl_plan6

parents 0dbaea7a 62f1546e
......@@ -16,7 +16,6 @@ import org.aspectj.lang.annotation.Before;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;
import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.ResponseBody;
import org.typroject.tyboot.core.foundation.context.RequestContext;
......
......@@ -252,6 +252,7 @@ SELECT
(
cf.state_code IN ('94', '98')
OR cf.state_code IS NULL
or LENGTH(cf.state_code) = 0
)
AND cf.is_delete = FALSE
<if test="jobCode != null">
......
......@@ -234,11 +234,11 @@ public class ConfirmAlarmServiceImpl extends ServiceImpl<ConfirmAlarmMapper, Equ
}
// syncDataService.syncCreatedSendAlarmReport(ent);
}
//数字换流站使用
mqttSendGateway.sendToMqtt(TopicEnum.EQZXDT.getTopic(), "");
TransactionSynchronizationManager.registerSynchronization(new TransactionSynchronization() {
@Override
public void afterCommit() {
//数字换流站使用
mqttSendGateway.sendToMqtt(TopicEnum.EQZXDT.getTopic(), "");
JSONObject jsonObject = new JSONObject();
jsonObject.put("seqNo", UUID.randomUUID().toString().replace("-", "").toLowerCase());
mqttSendGateway.sendToMqtt(TopicEnum.ALARM_LOG_INSERT.getTopic(), jsonObject.toString());
......
package com.yeejoin.equipmanage.service.impl;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.Date;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.UUID;
import java.util.logging.Logger;
import java.util.stream.Collectors;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.equipmanage.common.entity.*;
import com.yeejoin.equipmanage.common.entity.publics.BaseEntity;
import liquibase.pro.packaged.W;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.transaction.support.TransactionSynchronization;
import org.springframework.transaction.support.TransactionSynchronizationManager;
import org.springframework.util.CollectionUtils;
import org.springframework.util.ObjectUtils;
import org.springframework.util.StringUtils;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
......@@ -39,54 +10,35 @@ import com.yeejoin.equipmanage.common.datasync.entity.FireEquipmentDefectAlarm;
import com.yeejoin.equipmanage.common.datasync.entity.FireEquipmentFaultAlarm;
import com.yeejoin.equipmanage.common.datasync.entity.FireEquipmentFireAlarm;
import com.yeejoin.equipmanage.common.dto.TemperatureAlarmDto;
import com.yeejoin.equipmanage.common.entity.vo.CarPropertyVo;
import com.yeejoin.equipmanage.common.entity.vo.EquipmentIndexVO;
import com.yeejoin.equipmanage.common.entity.vo.EquipmentSpecificVo;
import com.yeejoin.equipmanage.common.entity.vo.EquipmentStateVo;
import com.yeejoin.equipmanage.common.entity.vo.IndexStateVo;
import com.yeejoin.equipmanage.common.enums.AlarmStatusEnum;
import com.yeejoin.equipmanage.common.enums.AlarmTypeEnum;
import com.yeejoin.equipmanage.common.enums.CarForGisEnum;
import com.yeejoin.equipmanage.common.enums.EquipAndCarEnum;
import com.yeejoin.equipmanage.common.enums.EquipmentIndexLabelsEnum;
import com.yeejoin.equipmanage.common.enums.EquipmentRiskTypeEnum;
import com.yeejoin.equipmanage.common.enums.NBalarmEnum;
import com.yeejoin.equipmanage.common.enums.RiskLeverForAutoSys;
import com.yeejoin.equipmanage.common.enums.TemperatureAlarm;
import com.yeejoin.equipmanage.common.enums.TopicEnum;
import com.yeejoin.equipmanage.common.enums.TrueOrFalseEnum;
import com.yeejoin.equipmanage.common.entity.*;
import com.yeejoin.equipmanage.common.entity.publics.BaseEntity;
import com.yeejoin.equipmanage.common.entity.vo.*;
import com.yeejoin.equipmanage.common.enums.*;
import com.yeejoin.equipmanage.common.utils.DateUtils;
import com.yeejoin.equipmanage.common.utils.StringUtil;
import com.yeejoin.equipmanage.common.vo.CarIndexGisVo;
import com.yeejoin.equipmanage.common.vo.EquipmentIndexLabelsVo;
import com.yeejoin.equipmanage.common.vo.EquipmentVo;
import com.yeejoin.equipmanage.common.vo.IotDataVO;
import com.yeejoin.equipmanage.common.vo.Token;
import com.yeejoin.equipmanage.common.vo.TopicEntityVo;
import com.yeejoin.equipmanage.common.vo.*;
import com.yeejoin.equipmanage.fegin.SystemctlFeign;
import com.yeejoin.equipmanage.mapper.CarMapper;
import com.yeejoin.equipmanage.mapper.EquipmentSpecificAlarmLogMapper;
import com.yeejoin.equipmanage.mapper.EquipmentSpecificAlarmMapper;
import com.yeejoin.equipmanage.mapper.EquipmentSpecificIndexMapper;
import com.yeejoin.equipmanage.mapper.EquipmentSpecificMapper;
import com.yeejoin.equipmanage.mapper.FireFightingSystemMapper;
import com.yeejoin.equipmanage.mapper.*;
import com.yeejoin.equipmanage.remote.RemoteSecurityService;
import com.yeejoin.equipmanage.service.ICarPropertyService;
import com.yeejoin.equipmanage.service.IEquipmentAlarmReportDayService;
import com.yeejoin.equipmanage.service.IEquipmentIndexService;
import com.yeejoin.equipmanage.service.IEquipmentService;
import com.yeejoin.equipmanage.service.IEquipmentSpecificAlarmLogService;
import com.yeejoin.equipmanage.service.IEquipmentSpecificAlarmService;
import com.yeejoin.equipmanage.service.IEquipmentSpecificIndexService;
import com.yeejoin.equipmanage.service.IEquipmentSpecificSerivce;
import com.yeejoin.equipmanage.service.IFireFightingSystemService;
import com.yeejoin.equipmanage.service.IMainIotMonitorSerivce;
import com.yeejoin.equipmanage.service.ISyncDataService;
import com.yeejoin.equipmanage.service.MqttReceiveService;
import com.yeejoin.equipmanage.service.MqttSendGateway;
import com.yeejoin.equipmanage.service.*;
import com.yeejoin.equipmanage.utils.BeanUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.transaction.support.TransactionSynchronization;
import org.springframework.transaction.support.TransactionSynchronizationManager;
import org.springframework.util.CollectionUtils;
import org.springframework.util.ObjectUtils;
import org.springframework.util.StringUtils;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.stream.Collectors;
//import net.sf.json.JSONObject;
......@@ -97,7 +49,6 @@ import lombok.extern.slf4j.Slf4j;
* <pre>
* &#64;description: 增量数据处理
* </pre>
*
* @date 2020/11/3 13:39
*/
@Slf4j
......@@ -226,7 +177,7 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
JSONObject json = JSONObject.parseObject(message);
Iterator it = json.entrySet().iterator();
List<IotDataVO> iotDatalist = new ArrayList<IotDataVO>();
List<IotDataVO> iotDatalist = new ArrayList<>();
String traceId = "";
while (it.hasNext()) {
IotDataVO iotDataVO = new IotDataVO();
......@@ -391,7 +342,7 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
}
});
boolean updateBatchById = false;
if(!carIndexsList.isEmpty()){
if (!carIndexsList.isEmpty()) {
carPropertyService.updateBatchById(carIndexsList);
updateBatchById = true;
}
......@@ -443,7 +394,7 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
// 添加性能指标项
//flag 无意义 getSpeIndex 方法其他地方共用 做了额外封装 为0时走原逻辑
int flag = 0;
equipmentStateVo.setSpeindexList(fireFightingSystemService.getSpeIndex(index.getEquipmentSpecificId(),flag));
equipmentStateVo.setSpeindexList(fireFightingSystemService.getSpeIndex(index.getEquipmentSpecificId(), flag));
Map<String, Object> topicObject = new HashMap<>();
topicObject.put("equipCode", equipmentStateVo.getEquipCode());
if (TrueOrFalseEnum.real.value.toUpperCase().equals(index.getValue().toUpperCase())) {
......@@ -452,6 +403,7 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
topicObject.put("color", "");
}
Map<String, Object> map = JSON.parseObject(JSON.toJSONString(equipmentStateVo));
topicObject.put("uuid", UUID.randomUUID().toString());
map.put(canvasTopic, topicObject);
// 发送数据至画布
......@@ -493,11 +445,11 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
//告警弹窗需要根据人员单位判断是否展示 后端返回单位Code 前端判断
LambdaQueryWrapper<EquipmentSpecific> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(BaseEntity::getId,equipmentSpecificAlarmLog.getEquipmentSpecificId());
wrapper.eq(BaseEntity::getId, equipmentSpecificAlarmLog.getEquipmentSpecificId());
EquipmentSpecific equipmentSpecific = equipmentSpecificMapper.selectOne(wrapper);
if (!ValidationUtil.isEmpty(equipmentSpecific) && !ValidationUtil.isEmpty(equipmentSpecific.getBizOrgCode())){
if (!ValidationUtil.isEmpty(equipmentSpecific) && !ValidationUtil.isEmpty(equipmentSpecific.getBizOrgCode())) {
Map<String, String> equipMap = new HashMap<>();
equipMap.put("bizOrgCode",equipmentSpecific.getBizOrgCode());
equipMap.put("bizOrgCode", equipmentSpecific.getBizOrgCode());
model.setExtras(equipMap);
}
model.setRelationId(String.valueOf(equipmentSpecificAlarmLog.getId()));
......
......@@ -1141,6 +1141,11 @@ public class ExcelServiceImpl {
List<FireTeam> excelEntityList = new ArrayList<>();
excelDtoList.forEach(item -> {
if (StringUtils.isEmpty(item.getCompanyCode()) || StringUtils.isEmpty(item.getName()) ||
StringUtils.isEmpty(item.getTypeCode()) || StringUtils.isEmpty(item.getAddress()) ||
StringUtils.isEmpty(item.getLatitude()) || StringUtils.isEmpty(item.getLongitude())) {
throw new BadRequest("请检查必填项是否为空");
}
FireTeam fireTeam = new FireTeam();
fireTeam = Bean.toPo(item, fireTeam);
fireTeam = Bean.toPo(getCurrentInfo(), fireTeam);
......
......@@ -2,6 +2,7 @@ package com.yeejoin.amos.knowledgebase.face.orm.dao;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.amos.knowledgebase.face.orm.entity.KnowledgeTag;
import org.apache.ibatis.annotations.Param;
import java.util.List;
......@@ -17,4 +18,11 @@ public interface TagMapper extends BaseMapper<KnowledgeTag> {
List<KnowledgeTag> queryTagByNameInPublishedDoc(String tagName);
/**
* 统计标签被引用数量
* @param sequenceNbr
* @param quoteType
* @return
*/
Integer queryCountByTagSeq(@Param("sequenceNbr") Long sequenceNbr, @Param("quoteType") String quoteType);
}
\ No newline at end of file
......@@ -57,7 +57,13 @@ public class TagService extends BaseService<KnowledgeTagModel, KnowledgeTag, Tag
private DocContentService docContentService;
@Autowired
private ConfigLoader configLoader;
@Autowired
private TagMapper tagMapper;
/**
* 统计方式-文档是否发布
*/
public static final String QUOTE_TYPE_PUBLISHED = "PUBLISHED";
/**
* 创建标签
......@@ -169,7 +175,10 @@ public class TagService extends BaseService<KnowledgeTagModel, KnowledgeTag, Tag
for (KnowledgeTag tag : tagList) {
KnowledgeTagModel tagModel = Bean.toModel(tag, new KnowledgeTagModel());
//加入引用数量
tagModel.setReferenceNumber(getAllReference(tagModel.getSequenceNbr()));
// tagModel.setReferenceNumber(getAllReference(tagModel.getSequenceNbr()));
//被引用且已发布数量
Integer num = tagMapper.queryCountByTagSeq(tagModel.getSequenceNbr(), QUOTE_TYPE_PUBLISHED);
tagModel.setReferenceNumber(num);
//获取拼音首字母
String pinyin;
try {
......
......@@ -18,4 +18,15 @@
WHERE DOC_STATUS = "PUBLISHED"))
AND TAG_NAME LIKE CONCAT('%', #{tagName},'%')
</select>
<select id="queryCountByTagSeq" resultType="java.lang.Integer">
SELECT
count( ti.SEQUENCE_NBR )
FROM
knowledge_tag_instance ti
LEFT JOIN knowledge_doc_content dc ON dc.SEQUENCE_NBR = ti.TARGET_SEQ
WHERE
ti.TAG_SEQ = #{sequenceNbr}
AND dc.DOC_STATUS = #{quoteType}
</select>
</mapper>
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