Commit 1ebdb002 authored by xixinzhao's avatar xixinzhao

Merge branch 'develop_dl_3.7.0.9' into develop_dl_0703

# Conflicts: # amos-boot-biz-common/src/main/java/com/yeejoin/amos/boot/biz/common/utils/RedisKey.java # amos-boot-module/amos-boot-module-api/amos-boot-module-equip-api/src/main/java/com/yeejoin/equipmanage/common/entity/vo/EquipmentIndexVO.java # amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/config/EquipmentIndexCacheRunner.java # amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/impl/MqttReceiveServiceImpl.java # amos-boot-system-equip/src/main/java/com/yeejoin/AmostEquipApplication.java # amos-boot-system-equip/src/main/resources/mapper/EquipmentSpecificIndexMapper.xml # amos-boot-system-equip/src/main/resources/mapper/EquipmentSpecificMapper.xml # amos-boot-utils/amos-boot-utils-message/src/main/resources/application-dev.properties
parents e31cfb1f 6091b4fd
......@@ -48,6 +48,11 @@ public class RedisKey {
*/
public static final String EQUIP_INDEX_ADDRESS = "equip_index_address";
/**
* 装备指标Key值
*/
public static final String EQUIP_INDEX_ADDRESS_KEY = "equip_index_address_key";
/** 驼峰转下划线(简单写法,效率低于 ) */
public static String humpToLine(String str) {
return str.replaceAll("[A-Z]", "_$0").toLowerCase();
......@@ -74,7 +79,7 @@ public class RedisKey {
public static String buildPatternKey(String token) {
return REGION_REDIS_PREFIX + "*" + "_" + token;
}
/**
* 判断str1中包含str2的个数
* @param str1
......
......@@ -22,7 +22,6 @@ import lombok.EqualsAndHashCode;
@ApiModel(value="OrgUsr对象", description="人员信息")
public class OrgPersonDto extends BaseDto {
/**
*
*/
......@@ -82,4 +81,6 @@ public class OrgPersonDto extends BaseDto {
@ApiModelProperty(value = "动态表单值")
private List<DynamicFormInstance> dynamicFormValue;
private String personImg;
}
......@@ -99,4 +99,6 @@ public class OrgUsrDto extends BaseDto {
@ApiModelProperty(value = "消防信息实体")
private CompanyInfo companyInfo;
private String personImg;
}
......@@ -90,4 +90,7 @@ public class OrgUsr extends BaseEntity {
@ApiModelProperty(value = "管理类别")
@TableField(exist = false)
private String managementType;
@ApiModelProperty(value = "人员照片")
private String personImg;
}
......@@ -15,7 +15,9 @@ import java.util.Map;
public interface OrganizationMapper extends BaseMapper<Organization> {
Page<Map<String, Object>> getOrganizationInfo(Page<Map<String, Object>> page, @Param("bizOrgCode") String bizOrgCode);
List<Map<String, Object>> getOrganizationInfo(@Param("bizOrgCode") String bizOrgCode);
Map<String, Object> getTeamLeader();
Page<Map<String, Object>> getOrganizationList(Page<Map<String, Object>> page, @Param("bizOrgCode") String bizOrgCode);
......
......@@ -5,13 +5,22 @@
<select id="getOrganizationInfo" resultType="java.util.Map">
SELECT
( SELECT COUNT( 1 ) FROM cb_organization_user cou WHERE cou.emergency_team_id = co.sequence_nbr ) AS
value,
co.emergency_team_name AS name
FROM
cb_organization co
WHERE co.is_delete = 0
ORDER BY
co.sort desc
LIMIT 5
</select>
<select id="getTeamLeader" resultType="Map">
SELECT
(
SELECT
Ifnull (GROUP_CONCAT( cou.biz_org_name ),'') AS
value
Ifnull (GROUP_CONCAT( cou.biz_org_name ),'') AS value
FROM
(
SELECT
......@@ -32,25 +41,34 @@
)
AND cdfi.field_code = 'userId'
) temp
LEFT JOIN cb_org_usr cou ON cou.sequence_nbr = temp.userId
WHERE cou.is_delete = 0
) AS
value
,
'当值值长' AS name UNION
(
LEFT JOIN cb_org_usr cou ON cou.sequence_nbr = temp.userId WHERE cou.is_delete = 0
) AS value,
(
SELECT
( SELECT COUNT( 1 ) FROM cb_organization_user cou WHERE cou.emergency_team_id = co.sequence_nbr ) AS
value
,
co.emergency_team_name AS name
Ifnull(GROUP_CONCAT( dfi.field_value ),'') AS tel
FROM
cb_organization co
WHERE co.is_delete = 0
ORDER BY
co.sort desc
LIMIT 5
(
SELECT
cdfi.field_value AS userId
FROM
cb_dynamic_form_instance cdfi
WHERE
cdfi.instance_id IN (
SELECT
cdps.instance_id
FROM
cb_duty_person_shift cdps
LEFT JOIN cb_dynamic_form_instance cdfi ON cdps.instance_id = cdfi.instance_id
WHERE
cdfi.field_code = 'postType'
AND field_value = '1676'
AND cdps.duty_date = ( SELECT DATE_FORMAT(NOW(),"%Y-%m-%d"))
)
AND cdfi.field_code = 'userId'
) temp
LEFT JOIN cb_dynamic_form_instance dfi ON dfi.instance_id = temp.userId WHERE dfi.field_code = 'telephone'
) AS tel,
'当值值长' AS name
</select>
<select id="getOrganizationList" resultType="java.util.Map">
SELECT
......
......@@ -6,10 +6,10 @@ import java.util.List;
import java.util.Map;
public enum PointCheckTypeEnum {
WGJC("外观检查", "WGJC"),
GNCS("功能测试", "GNCS"),
HJJC("环境检查", "HJJC"),
QT("其他", "QT");
WGJC("外观检查", "外观检查"),
GNCS("功能测试", "功能测试"),
HJJC("环境检查", "环境检查"),
QT("其他", "其他");
private String name;
......
......@@ -778,9 +778,7 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
public String getPersonImg(String id) {
Long userId = Long.valueOf(id);
OrgUsr orgUsr = this.baseMapper.queryByUserId(userId);
List<DynamicFormInstanceDto> list = alertFormValueServiceImpl.listBySeqnum(orgUsr.getSequenceNbr());
String str = list.get(0).getFieldValue();
return str;
return orgUsr.getPersonImg();
}
public List<FormValue> getFormValueDetail(Long id) throws Exception {
......@@ -2964,6 +2962,7 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
orgUsr.setBizOrgName(peopleBasicInfoDto.getName());
orgUsr.setParentId(peopleBasicInfoDto.getCompany());
orgUsr.setParentName(peopleBasicInfoDto.getBizOrgName());
orgUsr.setPersonImg(peopleBasicInfoDto.getPersonImg());
orgUsr.setIsDelete(false);
return orgUsr;
}
......@@ -3293,9 +3292,11 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
if ("1601".equals(type)) {
deleteFirefighters(id);
}
// 巡检站端与中心级数据同步
// 4.解决人员更换岗位类型然后删除,App打卡还有脏数据问题
firefightersService.update(new UpdateWrapper<Firefighters>().eq("org_usr_id", id).set("is_delete", 1));
// 巡检站端与中心级数据同步
TransactionSynchronizationManager.registerSynchronization(new TransactionSynchronization() {
@Override
public void afterCommit() {
......
......@@ -32,11 +32,16 @@ public class EquipmentIndexCacheRunner implements CommandLineRunner {
public void run(String... args) throws Exception {
log.info(">>服务启动执行,执行预加载数据等操作");
redisUtils.del(RedisKey.EQUIP_INDEX_ADDRESS);
redisUtils.del(RedisKey.EQUIP_INDEX_ADDRESS_KEY);
List<EquipmentIndexVO> equipSpecificIndexList = equipmentSpecificIndexMapper.getEquipSpecificIndexList(null);
Map<String, Object> equipmentIndexVOMap = equipSpecificIndexList.stream()
.filter(v -> v.getGatewayId() != null && v.getIndexAddress() !=null)
.filter(v -> v.getGatewayId() != null)
.collect(Collectors.toMap(vo -> vo.getIndexAddress() + "_" + vo.getGatewayId(), Function.identity(),(v1, v2) -> v1));
Map<String, Object> equipmentIndexKeyMap = equipSpecificIndexList.stream()
.filter(v -> v.getIndexAddress() != null && v.getGatewayId() == null)
.collect(Collectors.toMap(EquipmentIndexVO::getIndexAddress, Function.identity(),(v1, v2) -> v1));
redisUtils.hmset(RedisKey.EQUIP_INDEX_ADDRESS, equipmentIndexVOMap);
redisUtils.hmset(RedisKey.EQUIP_INDEX_ADDRESS_KEY, equipmentIndexKeyMap);
}
}
}
\ No newline at end of file
......@@ -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();
......
......@@ -899,9 +899,18 @@ public class TopographyController extends AbstractBaseController {
String json = JSON.toJSONString(entity.getResult());
List<Map<String, String>> listObject = (List<Map<String, String>>) JSONArray.parse(json);
List<IotDataVO> vos = new ArrayList<>();
Map<String, List<Date>> dateMap = new HashMap<>();
for (Map<String, String> mapList : listObject) {
for (Map.Entry entry : mapList.entrySet()) {
if (!"name".equals(entry.getKey()) && !"deviceName".equals(entry.getKey())) {
if (!"name".equals(entry.getKey()) && !"deviceName".equals(entry.getKey()) && !"time".equals(entry.getKey()) && !"createdTime".equals(entry.getKey())) {
if (!dateMap.containsKey(entry.getKey())) {
ArrayList<Date> dates1 = new ArrayList<>();
dates1.add(dateParse(mapList.get("time")));
dateMap.put(entry.getKey().toString(), dates1);
} else {
dateMap.get(entry.getKey()).add(dateParse(mapList.get("time")));
}
IotDataVO vo = new IotDataVO();
vo.setKey(String.valueOf(entry.getKey()));
vo.setValue(String.valueOf(entry.getValue()));
......@@ -909,25 +918,15 @@ public class TopographyController extends AbstractBaseController {
}
}
}
Map<String, List<Date>> dateMap = new HashMap<>();
for (int i = 0; i < vos.size(); i = i + 2) {
Date useDate = null;
String indexKey = null;
if (vos.get(i).getKey().equals("time")) {
useDate = dateParse(vos.get(i).getValue().toString());
indexKey = String.valueOf(vos.get(i + 1).getKey());
} else {
useDate = dateParse(vos.get(i).getValue().toString());
indexKey = String.valueOf(vos.get(i).getKey());
}
if (!dateMap.containsKey(indexKey)) {
ArrayList<Date> dates1 = new ArrayList<>();
dates1.add(useDate);
dateMap.put(indexKey, dates1);
} else {
dateMap.get(indexKey).add(useDate);
}
}
// for (int i = 0; i < vos.size(); i = i + 2) {
// Date useDate = null;
// String indexKey = null;
// if (vos.get(i).getKey().equals("time")) {
// useDate = dateParse(vos.get(i).getValue().toString());
// indexKey = String.valueOf(vos.get(i + 1).getKey());
// }
//
// }
List<EquipmentSpecificIndex> indexes = equipmentSpecificIndexMapper.getEquipmentSpeIndexByIotCodeAndTrend(iotCode);
if (0 < indexes.size()) {
List<TopographyIotIndexTrendVo> list = new ArrayList<>();
......@@ -1437,13 +1436,17 @@ public class TopographyController extends AbstractBaseController {
private Date dateParse(String value) throws ParseException {
String strDate = value.substring(0, 19);
SimpleDateFormat sdf = new SimpleDateFormat(ISO8601_DATE_HOUR_MIN_SEC);
SimpleDateFormat sdf1 = new SimpleDateFormat(DateUtils.DATE_TIME_PATTERN);
sdf.setTimeZone(TimeZone.getTimeZone("UTC"));
Date date = sdf.parse(strDate);
String time = DateTimeUtil.format(date, DateTimeUtil.ISO_DATE_HOUR24_MIN_SEC);
return sdf1.parse(time);
if(value.length() > 19) {
String strDate = value.substring(0, 19);
SimpleDateFormat sdf = new SimpleDateFormat(ISO8601_DATE_HOUR_MIN_SEC);
SimpleDateFormat sdf1 = new SimpleDateFormat(DateUtils.DATE_TIME_PATTERN);
sdf.setTimeZone(TimeZone.getTimeZone("UTC"));
Date date = sdf.parse(strDate);
String time = DateTimeUtil.format(date, DateTimeUtil.ISO_DATE_HOUR24_MIN_SEC);
return sdf1.parse(time);
} else {
return DateUtils.dateParse(value, DateUtils.DATE_TIME_PATTERN);
}
}
/***
......
......@@ -232,4 +232,6 @@ public interface EquipmentSpecificAlarmMapper extends BaseMapper<EquipmentSpecif
List<Map<String, Object>> stationInfo();
void updateStatusByAlarm();
void clearAlarmData(@Param("equipmentSpecificId") Long equipmentSpecificId);
}
......@@ -2,6 +2,9 @@ package com.yeejoin.equipmanage.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.equipmanage.common.entity.ManufacturerInfo;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* Mapper 接口
......@@ -14,7 +17,6 @@ public interface ManufacturerInfoMapper extends BaseMapper<ManufacturerInfo> {
int checkName(String name, Long id);
String checkDelete(Long id);
List<String> checkDelete(@Param("ids") List<Long> ids);
}
......@@ -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);
}
}
......@@ -131,8 +131,8 @@ public class EquipmentIndexImpl extends ServiceImpl<EquipmentIndexMapper, Equipm
CarProperty carProperty = new CarProperty();
carProperty.setCarId(car.getId());
carProperty.setEquipmentIndexId(equipmentIndex.getId());
carProperty.setEquipmentIndexKey(equipmentIndex.getPerfQuotaName());
carProperty.setEquipmentIndexName(equipmentIndex.getPerfQuotaDefinitionId());
carProperty.setEquipmentIndexKey(equipmentIndex.getPerfQuotaDefinitionId());
carProperty.setEquipmentIndexName(equipmentIndex.getPerfQuotaName());
if (bool.get()) {
carProperty.setEmergencyLevelColor(signalClassify.getEmergencyLevelColor());
carProperty.setIsAlarm(signalClassify.getIsAlarm());
......
......@@ -383,14 +383,8 @@ public class EquipmentServiceImpl extends ServiceImpl<EquipmentMapper, Equipment
@Override
public String checkDelete(List<Long> ids) {
String res = "";
for (Long id : ids) {
String s = manufacturerInfoMapper.checkDelete(id);
if (s != null && !("").equals(s)) {
res = res + s + " , ";
}
}
return res;
List<String> s = manufacturerInfoMapper.checkDelete(ids);
return String.join(",", s);
}
@Override
......
......@@ -175,7 +175,7 @@ public class EquipmentSpecificAlarmLogServiceImpl extends ServiceImpl<EquipmentS
EquipmentIndex equipmentIndex = equipmentIndexMapper.getMessage(equipmentSpecificId, pressurePumpStart);
LambdaQueryWrapper<EquipmentSpecificAlarm> lambda = new QueryWrapper<EquipmentSpecificAlarm>().lambda();
lambda.eq(EquipmentSpecificAlarm::getEquipmentSpecificId, equipmentSpecific.getId());
lambda.eq(EquipmentSpecificAlarm::getEquipmentSpecificIndexKey, equipmentSpecific.getRealtimeIotIndexKey());
lambda.eq(EquipmentSpecificAlarm::getEquipmentSpecificIndexKey, pressurePumpStart);
lambda.eq(EquipmentSpecificAlarm::getStatus, AlarmStatusEnum.BJ.getCode());
lambda.orderByDesc(EquipmentSpecificAlarm::getCreateDate);
lambda.last("limit 1");
......
......@@ -1004,6 +1004,7 @@ public class EquipmentSpecificSerivceImpl extends ServiceImpl<EquipmentSpecificM
equipmentDetailService.removeById(equipmentSpecific.getEquipmentDetailId());
}
if (res > 0) {
equipmentSpecificAlarmMapper.clearAlarmData(id);
// 删除设备动态表单扩展属性
return formInstanceEquipService.deleteInstanceById(id);
} else {
......
......@@ -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;
}
......
......@@ -7,6 +7,7 @@ import com.yeejoin.amos.boot.module.jcs.api.service.ICcsToStationUserInfo;
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;
......@@ -16,6 +17,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;
......@@ -50,22 +52,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);
}
}
......
......@@ -5,6 +5,7 @@ import java.util.*;
import javax.servlet.http.HttpServletRequest;
import com.alibaba.fastjson.JSONObject;
import com.yeejoin.amos.boot.module.common.api.entity.*;
import com.yeejoin.amos.boot.module.common.api.enums.ExceptionEnum;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.BeanUtils;
......@@ -50,14 +51,6 @@ import com.yeejoin.amos.boot.module.common.api.dto.FirefightersZhDto;
import com.yeejoin.amos.boot.module.common.api.dto.OrgMenuDto;
import com.yeejoin.amos.boot.module.common.api.dto.PeopleBasicInfoDto;
import com.yeejoin.amos.boot.module.common.api.dto.PeopleInfoDto;
import com.yeejoin.amos.boot.module.common.api.entity.FireTeam;
import com.yeejoin.amos.boot.module.common.api.entity.Firefighters;
import com.yeejoin.amos.boot.module.common.api.entity.FirefightersContacts;
import com.yeejoin.amos.boot.module.common.api.entity.FirefightersContract;
import com.yeejoin.amos.boot.module.common.api.entity.FirefightersEducation;
import com.yeejoin.amos.boot.module.common.api.entity.FirefightersJacket;
import com.yeejoin.amos.boot.module.common.api.entity.FirefightersPost;
import com.yeejoin.amos.boot.module.common.api.entity.FirefightersThought;
import com.yeejoin.amos.boot.module.common.api.enums.OrgPersonEnum;
import com.yeejoin.amos.boot.module.common.biz.service.impl.FireTeamServiceImpl;
import com.yeejoin.amos.boot.module.common.biz.service.impl.FirefightersContactsServiceImpl;
......
......@@ -38,12 +38,25 @@ public class OrganizationImpl extends BaseService<Organization, Organization, Or
@Override
public Page<Map<String, Object>> getOrganizationInfo(Page<Map<String, Object>> page, String bizOrgCode) {
Page<Map<String, Object>> page1 = new Page<>();
List<Map<String, Object>> list = organizationMapper.getOrganizationInfo(page, bizOrgCode).getRecords();
List<Map<String, Object>> list = organizationMapper.getOrganizationInfo(bizOrgCode);
LambdaQueryWrapper<Organization> wrapper = new LambdaQueryWrapper<>();
wrapper.orderByDesc(Organization::getSort);
List<Organization> organizations = this.baseMapper.selectList(wrapper);
List<Map<String, Object>> res = new ArrayList<>();
if (0 < list.size()) {
// 获取值长
Map<String, Object> resMap = this.baseMapper.getTeamLeader();
Map<String, Object> leaderMap = new HashMap<>();
if (ObjectUtils.isEmpty(resMap.get("value"))) {
leaderMap.put("name", resMap.get("name") + "");
leaderMap.put("value", "");
} else {
// 跟现场确认此处值长只有一人,所以只做一人处理
leaderMap.put("name", resMap.get("name") + " " + "1人");
leaderMap.put("value", resMap.get("value") + "-" + resMap.get("tel"));
}
res.add(leaderMap);
for (Map<String, Object> map : list) {
Map<String, Object> tempMap = new HashMap<>();
if (ObjectUtils.isEmpty(map.get("value"))) {
......@@ -51,19 +64,22 @@ public class OrganizationImpl extends BaseService<Organization, Organization, Or
tempMap.put("value", "");
} else {
tempMap.put("name", map.get("name") + " " + map.get("value") + "人");
Organization organization = organizations.stream().filter(x -> x.getEmergencyTeamName().equals(map.get("name"))).collect(Collectors.toList()).get(0);
String[] nameArr = organization.getGroupLeader().split(",");
List<String> nameList = Arrays.asList(nameArr);
String[] telArr = new String[nameList.size()];
if (ObjectUtils.isNotEmpty(organization.getGroupLeaderTel())) {
telArr = organization.getGroupLeaderTel().split("\n");
}
List<String> telList = Arrays.asList(telArr);
List<String> valueList = new ArrayList<>();
for (int i = 0; i < nameList.size(); i++) {
valueList.add(nameList.get(i) + "-" + telList.get(i));
List<Organization> organizationList = organizations.stream().filter(x -> x.getEmergencyTeamName().equals(map.get("name"))).collect(Collectors.toList());
if (0 < organizationList.size()) {
Organization organization = organizationList.get(0);
String[] nameArr = organization.getGroupLeader().split(",");
List<String> nameList = Arrays.asList(nameArr);
String[] telArr = new String[nameList.size()];
if (ObjectUtils.isNotEmpty(organization.getGroupLeaderTel())) {
telArr = organization.getGroupLeaderTel().split("\n");
}
List<String> telList = Arrays.asList(telArr);
List<String> valueList = new ArrayList<>();
for (int i = 0; i < nameList.size(); i++) {
valueList.add(nameList.get(i) + "-" + telList.get(i));
}
tempMap.put("value", String.join(",", valueList));
}
tempMap.put("value", String.join(",", valueList));
}
res.add(tempMap);
}
......
......@@ -713,8 +713,8 @@ public class InputItemController extends AbstractBaseController {
}
//如果为1则为否,顺应机场逻辑
param.setCustomType("1".equals(param.getCustomType()) ? null : param.getCustomType());
param.setKeyPartsType("1".equals(param.getKeyPartsType()) ? null : param.getKeyPartsType());
/* param.setCustomType("1".equals(param.getCustomType()) ? null : param.getCustomType());
param.setKeyPartsType("1".equals(param.getKeyPartsType()) ? null : param.getKeyPartsType());*/
AgencyUserModel user = getUserInfo();
if (ObjectUtils.isEmpty(user)) {
return CommonResponseUtil.failure("用户session过期");
......@@ -752,6 +752,7 @@ 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());
inputItem.setInputClassify(param.getInputClassify());
inputItem.setDataJson(JSONObject.toJSONString(map));
}else if(param.getItemType().equals("选择")){
......@@ -771,10 +772,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));
}
......
......@@ -49,8 +49,8 @@ public class AmostEquipApplication {
@Autowired
private EmqKeeper emqKeeper;
// @Autowired
// private CarIotListener carIotListener;
@Autowired
private CarIotListener carIotListener;
@Autowired
private CarIotNewListener carIotNewListener;
......@@ -60,7 +60,7 @@ public class AmostEquipApplication {
public static void main(String[] args) throws UnknownHostException {
public static void main(String[] args) throws UnknownHostException {
ConfigurableApplicationContext context = SpringApplication.run(AmostEquipApplication.class, args);
Environment env = context.getEnvironment();
String ip = InetAddress.getLocalHost().getHostAddress();
......@@ -85,8 +85,14 @@ public class AmostEquipApplication {
*/
@Bean
void initMqtt() throws MqttException {
emqKeeper.getMqttClient().subscribe("+/+/property", 1, carIotNewListener);
try {
emqKeeper.subscript("+/+/property", 1, carIotListener);
} catch (Exception e) {
e.printStackTrace();
logger.error("EMQ初始化连接失败!");
}
}
//江西电建服务重启后对于未计时且未结束的里程的进行处理
@Bean
void initCarMelige() {
......
......@@ -6,8 +6,8 @@
"faultNameKey": "FHS_PressurePump_Fault,FHS_PressurePump_RunFault,FHS_PressurePump_OverLoadFault",
"expire": 14400,
"countExpire": 1209600,
"equipmentCode": "92010800KAL44",
"pipePressureEquipmentCode": "92011000T5Q44",
"equipmentCode": "92010800",
"pipePressureEquipmentCode": "92011000",
"top": "100",
"countRedisKey": "Count"
}
......
......@@ -573,6 +573,7 @@
AND biz_org_code like concat(#{bizOrgCode}, '%')
AND is_delete = '0'
AND input_type!='1'
AND key_parts_type='0'
</select>
<select id="countByCustomType" resultType="int">
......@@ -581,6 +582,7 @@
AND biz_org_code like concat(#{bizOrgCode}, '%')
AND is_delete = '0'
AND input_type!='1'
AND custom_type='0'
</select>
<select id="countAll" resultType="int">
......
......@@ -155,10 +155,10 @@
<select id="checkDelete" resultType="String">
select
(select name from wl_equipment_detail eq where eq.id = sto.equipment_detail_id) as name
(select name from wl_equipment_detail eq where eq.id = sto.equipment_detail_id) as name
from wl_stock_detail as sto
where
equipment_detail_id = #{id}
equipment_detail_id = #{id}
group by equipment_detail_id
</select>
<select id="getWareId" resultType="Long">
......
......@@ -1590,4 +1590,10 @@
GROUP BY
a.`name`
</select>
<delete id="clearAlarmData">
DELETE FROM wl_equipment_specific_alarm WHERE equipment_specific_id = #{equipmentSpecificId};
DELETE FROM wl_equipment_specific_alarm_log WHERE equipment_specific_id = #{equipmentSpecificId};
DELETE FROM wl_equipment_alarm_report_day WHERE equipment_specific_id = #{equipmentSpecificId};
</delete>
</mapper>
\ No newline at end of file
......@@ -491,7 +491,7 @@
left join wl_warehouse_structure str on str.id = wes.warehouse_structure_id
left join wl_stock_detail wlsd on wes.id = wlsd.equipment_specific_id
where wed.production_date is not null
and wlsd.status != 7
and wlsd.status != 7
</select>
<select id="getEquipIndexInIndex" resultType="com.yeejoin.equipmanage.common.entity.EquipmentSpecificIndex">
SELECT
......@@ -510,7 +510,7 @@
LEFT JOIN wl_equipment_detail wled ON es.equipment_detail_id = wled.id
<where>
<if test="list != null and list.size > 0 and type = 'id'">
si.equipment_index_key IN
si.equipment_index_key IN
<foreach collection="list" item="item" index="index" open="(" close=")" separator=",">
#{item}
</foreach>
......@@ -523,45 +523,45 @@
<!-- 根据信号索引查询装备性能指标 -->
<select id="getEquipmentSpeIndexByIndexAddress"
resultType="com.yeejoin.equipmanage.common.entity.EquipmentSpecificIndex">
SELECT wesi.id AS id,
wei.name_key AS nameKey,
wesi.value AS value,
wesi.equipment_specific_id AS equipmentSpecificId,
wesi.equipment_index_id AS equipmentIndexId,
wesi.equipment_index_name AS equipmentIndexName,
wesi.equipment_index_key AS equipmentIndexKey,
wesi.value_label AS valueLabel,
wei.type_code AS typeCode,
wei.type_name AS typeName,
wei.name AS indexName,
wesi.unit AS indexUnitName,
wes.org_code AS orgCode,
ed.`name` AS equipmentSpecificName,
ed.equipment_name AS equipmentName,
wes.iot_code AS iotCode,
wes.code AS specificCode,
wei.`name` AS equipmentSpecificIndexName,
wei.`value_enum` AS valueEnum,
wei.is_trend AS isTrend,
wes.qr_code AS qrCode,
wesi.update_date AS updateDate,
ed.code AS equipmentCode,
ed.equipment_id AS equipmentId,
ed.id AS equipmentDetailId,
wes.code as equipmentSpecificCode,
wes.system_id as systemId,
wesi.is_alarm as isAlarm,
wesi.emergency_level_color as emergencyLevelColor,
wesi.emergency_level as emergencyLevel,
wesi.emergency_level_describe as emergencyLevelDescribe,
wes.biz_org_name AS bizOrgName,
wes.biz_org_code AS bizOrgCode
SELECT wesi.id AS id,
wei.name_key AS nameKey,
wesi.value AS value,
wesi.equipment_specific_id AS equipmentSpecificId,
wesi.equipment_index_id AS equipmentIndexId,
wesi.equipment_index_name AS equipmentIndexName,
wesi.equipment_index_key AS equipmentIndexKey,
wesi.value_label AS valueLabel,
wei.type_code AS typeCode,
wei.type_name AS typeName,
wei.name AS indexName,
wei.unit AS indexUnitName,
wes.org_code AS orgCode,
ed.`name` AS equipmentSpecificName,
ed.equipment_name AS equipmentName,
wes.iot_code AS iotCode,
wes.code AS specificCode,
wei.`name` AS equipmentSpecificIndexName,
wei.`value_enum` AS valueEnum,
wei.is_trend AS isTrend,
wes.qr_code AS qrCode,
wesi.update_date AS updateDate,
ed.code AS equipmentCode,
ed.equipment_id AS equipmentId,
ed.id AS equipmentDetailId,
wes.code as equipmentSpecificCode,
wes.system_id as systemId,
wesi.is_alarm as isAlarm,
wesi.emergency_level_color as emergencyLevelColor,
wesi.emergency_level as emergencyLevel,
wesi.emergency_level_describe as emergencyLevelDescribe,
wes.biz_org_name AS bizOrgName,
wes.biz_org_code AS bizOrgCode
FROM wl_equipment_specific_index AS wesi
LEFT JOIN wl_equipment_specific AS wes ON wes.id = wesi.equipment_specific_id
LEFT JOIN wl_equipment_detail ed ON ed.id = wes.equipment_detail_id
LEFT JOIN wl_equipment_index AS wei ON wei.id = wesi.equipment_index_id
WHERE
wesi.index_address = #{indexAddress}
wesi.index_address = #{indexAddress}
<if test="gatewayId != null">
AND wesi.gateway_id = #{gatewayId}
</if>
......
......@@ -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
......@@ -1877,7 +1870,7 @@
WHERE
(
0 <![CDATA[<>]]> find_in_set(`fs`.`id`, `s`.`system_id`)
) limit 1
) LIMIT 1
) AS `chargePersonName`
FROM
`wl_equipment_specific_index` `si`
......
......@@ -26,8 +26,26 @@
</select>
<select id="checkDelete" resultType="string">
select name from wl_equipment_detail where equipment_id = #{id}
select
name
from
wl_equipment_detail
<where>
equipment_id IN
<foreach collection="ids" item="id" index="index" open="(" close=")" separator=",">
#{id}
</foreach>
</where>
union
select name from wl_car where equipment_id = #{id}
select
name
from
wl_car
<where>
equipment_id IN
<foreach collection="ids" item="id" index="index" open="(" close=")" separator=",">
#{id}
</foreach>
</where>
</select>
</mapper>
......@@ -3870,7 +3870,7 @@
</sql>
</changeSet>
<changeSet author="ltw" id="20230614-ltw-01">
<changeSet author="ltw" id="20230614-ltw-01" runOnChange="true">
<preConditions onFail="MARK_RAN">
<not>
<columnExists tableName="cb_organization_user" columnName="post_name"/>
......@@ -3878,7 +3878,19 @@
</preConditions>
<comment>modify table cb_organization_user modify columns</comment>
<sql>
ALTER TABLE `cb_organization_user` MODIFY `post_name` varchar(4000) DEFAULT NULL COMMENT '岗位名称'
ALTER TABLE `cb_organization_user` MODIFY `post_name` varchar(4000) DEFAULT NULL COMMENT '岗位名称';
</sql>
</changeSet>
<changeSet author="ky" id="2023-06-21-001">
<preConditions onFail="MARK_RAN">
<not>
<columnExists tableName="cb_org_usr" columnName="person_img"/>
</not>
</preConditions>
<comment>cb_org_usr add column</comment>
<sql>
alter table `cb_org_usr` add column `person_img` varchar(255) DEFAULT NULL COMMENT '人员照片'
</sql>
</changeSet>
......
......@@ -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初始化连接失败!");
}
......
......@@ -333,10 +333,10 @@
and a.equipment_type is not null
</if>
<if test="treeId != null and treeId != '' and treeId == '-4'">
and a.key_parts_type is not null
and a.key_parts_type ='0'
</if>
<if test="treeId != null and treeId != '' and treeId == '-5'">
and a.custom_type is not null
and a.custom_type ='0'
</if>
<if test="subCode!=null and subCode!='' and subCode!=' ' and
treeId != null and treeId != '' and treeId != '-3' and treeId != '-1' and
......
......@@ -83,17 +83,17 @@ emqx.max-inflight=1000
# 下面个配置默认站端 中心级系统的时候注释掉上边 放开下边
#站端配置
#需要监听得kafka消息主题 根据是否是中心极和站端选择需要监听得主题进行配置
#kafka.topics=null
kafka.topics=null
#需要监听得eqm消息主题 根据是否是中心极和站端选择需要监听得主题进行配置 emq.iot.created,
#emq.topic=emq.xf.created,emq.iot.created,emq.patrol.created,emq.sign.created,emq.bussSign.created,emq.user.created,emq.risk.created
emq.topic=emq.xf.created,emq.iot.created,emq.patrol.created,emq.sign.created,emq.bussSign.created,emq.user.created
##中心级配置配置
##需要监听得kafka消息主题 根据是否是中心极和站端选择需要监听得主题进行配置
kafka.topics=JKXT2BP-XFYY-Topic
#kafka.topics=JKXT2BP-XFYY-Topic
#
##需要监听得eqm消息主题 根据是否是中心极和站端选择需要监听得主题进行配置 emq.iot.created,
emq.topic=ccs-user-login-info,sync.execute
#emq.topic=
queue.kafka.topics=null
kafka.auto-startup=false
\ No newline at end of file
......@@ -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